A Turkish court issued a temporary injunction on Wednesday ordering the country's telecommunications authority to restore access to Twitter, five days after the government blocked access to the social network.
The ban, which triggered local and international criticism, came shortly after Prime Minister Recep Tayyip Erdogan threatened to "rip out the roots" of the social network that has been a conduit for links to audio recordings suggesting government corruption.
Erdogan said late on Tuesday that the social network "was threatening national security" and that it had refused to cooperate with Turkish authorities, who said the blockage was based on four court orders and imposed after complaints from citizens that Twitter was violating privacy.
Erdogan has cast the audio postings as part of a plot contrived by his political enemies to unseat him ahead of nationwide elections on Sunday, which are widely considered a referendum on his 11-year rule.
Nevertheless, many Turks found ways to circumvent the ban and access Twitter.
The country's main opposition party and Turkey's bar association described the ban as an "arbitrary decision" that was illegal and unconstitutional, and had launched an appeal at the Ankara administrative court, asking for it to be overturned, resulting in Wednesday's court decision.
It was not clear when or if the telecommunications authority would follow Wednesday's court order, but Twitter responded in a blog post on Wednesday, saying "there are no legal grounds for the blocking of our service in Turkey."
"With positive developments today concerning judicial review of this disproportionate and illegal administrative act of access banning the whole of Twitter, we expect the government to restore access to Twitter immediately so that its citizens can continue an open online dialogue ahead of the elections to be held at the end of this week," a company spokeswoman said in the post.
Al Jazeera and wire services