Ankara, Turkey -- A Turkish court ordered the telecommunications authority to restore access to Twitter on Wednesday, issuing an injunction five days after the government blocked access to the social network.

The ban came shortly after Prime Minister Recep Tayyip Erdogan threatened to "rip out the roots" of Twitter, which has been a conduit for links to recordings suggesting government corruption. Turkey holds crucial local elections Sunday, widely regarded as a referendum on Erdogan's rule.

The telecommunications authority had accused Twitter of disobeying Turkish court orders to remove content. The move drew international criticism, and many Turkish users flouted the ban, finding immediate ways to circumvent it. President Abdullah Gul tweeted his opposition to the blockage.

Deputy Prime Minister Bulent Arinc said the telecommunications authority would obey Wednesday's court decision when it received official notice, but reserved the right to appeal.