ISTANBUL — A Turkish court Wednesday ordered the lifting of last week’s Twitter ban, which came after the social media site was used to spread audio recordings implicating Prime Minister Recep Tayyip Erdogan in corruption.

The administrative court in Ankara will inform the telecommunications regulator TIB, which is expected to grant access to Twitter in the coming hours, private NTV television said.

The government blocked access to Twitter after Friday after Erdogan threatened to “rip out the roots” of the website over the links to recordings that appear to incriminate him and other top officials in corruption. In one recording a man believed to be Erdogan is heard instructing his son to get rid of vast amounts of cash from a home amid a police graft probe.

Erdogan says that recording is fabricated and insists he is a victim of a plot orchestrated by followers of a US-based Muslim cleric who want to discredit the government before the elections.

However, the government’s effort to shut down the service backfired, with many finding ways to continue to tweet and mock the government for what they said was a futile attempt at censorship. Even President Abdullah Gul worked around the ban, tweeting that shutting down social media networks cannot “be approved.” Turkey’s move to block Twitter sparked a wave of international criticism.

Government officials said Friday they were engaged in talks with Twitter and would restore access as soon as an agreement with the company is reached. Twitter said it hoped the dispute would be resolved soon. The government accuses Twitter of refusing to remove offensive content despite Turkish court orders.

It is not clear if these talks had any impact on the court’s decision.