* Ankara court rules to lift Twitter blockage decision
* Deputy PM says court rulings are to be abided by
* Erdogan has accused Twitter of undermining national security (Updates with deputy PM comments, details)
By Humeyra Pamuk
ANKARA, March 26 (Reuters) - A Turkish court upheld an appeal on Wednesday to end a blockage of Twitter that has provoked public outrage and drawn international condemnation only days ahead of the critical local elections.
But it was not immediately clear if or when the bar would be removed, although Deputy Prime Minister Bulent Arinc urged the Turkey's telecoms authority, which carried out the ban, to respect the court order.
"We abide by the court rulings, that's what the constitution orders. We may not like them, but we abide by them. If this decision is genuine ... then what TIB needs to do after this is obvious," Arinc told reporters in Hatay in televised comments.
Turkey's telecoms authority (TIB) blocked access to Twitter on Friday as Prime Minister Tayyip Erdogan battles a corruption scandal, in which a stream of anonymous postings purportedly revealing government wrongdoing have been posted on the platform.
Turkey's Bar Association challenged the blockage, saying it was without legal grounds and "an arbitrary decision".
An Ankara court on Wednesday found in favour of the association's request and ruled that TIB halt its block on the site.
Erdogan on Tuesday accused Twitter of "threatening national security" and has repeatedly defended the ban during rallies in the run up to a municipal election on Sunday that is seen as a test of whether he has been damaged by the allegations.
Erdogan has cast the audio postings on Twitter as part of a plot to unseat him, contrived by followers of his former ally, the U.S. based Islamist cleric Fetullah Gulen.
Reuters has not been able to verify the authenticity of the leaked recordings.
"Our problem is not Twitter itself but its approach ... The court ruling was conveyed to Twitter. It does not listen to it," Erdogan said in a TV interview late on Tuesday about the original decision to block access.
"You are threatening the national security of my country," he said in a strained voiced after weeks of campaigning.
Telecoms regulators have said their blockage was based on four court orders and was imposed after complaints from citizens that Twitter was violating privacy.
The ban has met widespread criticism both at home and abroad, with opposition politicians condemning it, and the U.S. State Department likening it to "21st Century book burning".
But many in Turkey have been able to get around the ban, either by using virtual private network (VPN) software or changing their Domain Name System (DNS) setting, effectively disguising their computers' geographical whereabouts.
Legal experts say TIB reserves the right to challenge the Ankara court's decision.
(Additional reporting by Gulsen Solaker and Ozge Ozbilgin; Writing by Humeyra Pamuk; Editing by Jonny Hogg and and Alison Williams)
Our Standards: The Thomson Reuters Trust Principles.