Turkey restricted access to Twitter hours after its prime minister, Recep Tayyip Erdoğan, threatened to "root out" the social media network where wiretapped recordings have been leaked, damaging the government's reputation ahead of local elections.

Some users trying to use Twitter were taken to a statement apparently from Turkey's telecommunications regulator (TIB).

The statement cited four court orders as the basis for blocking the site, where some users in recent weeks have posted voice recordings and documents purportedly showing evidence of corruption among Erdoğan's inner circle. It said that action had been taken against Twitter as a "protection measure".

But Turkish telecoms watchdog BTK said on Friday that the ban came after complaints were made by citizens that the social media platform was breaching privacy.

The watchdog had previously asked Twitter to remove some content but Twitter had failed to do so, the BTK said in a statement on its website.

"Because there was no other choice, access to Twitter was blocked in line with court decisions to avoid the possible future victimisation of citizens," it said.

The company made no formal statement but published a message on Thursday advising users in Turkey that it was possible to send tweets using mobile phone text messaging.

Erdoğan had made repeated threats to shut down social media sites after audio recordings of his alleged conversations suggesting corruption were leaked.

Two weeks ago he suggested that a total ban on sites like Facebook and YouTube were in his thoughts. The point was dismissed days later by the Turkish president, Abdullah Gul, but Erdoğan then repeated his claims. "We will wipe out all of these," Erdoğan told thousands of supporters at a rally in the north-west province of Bursa.

"The international community can say this, can say that. I don't care at all. Everyone will see how powerful the Republic of Turkey is," he said.

Previously, he said that his government was determined to stem the leaks he insisted were being instigated by followers of an influential US-based Muslim cleric, Reuters reported.

The agency said Erdoğan accused supporters of Fethullah Gülen of infiltrating police and the judiciary and of engaging in "espionage" saying that the group even listened in on his encrypted telephone lines. The Gülen movement denies involvement.

"We are determined on the issue, regardless of what the world may say," Erdoğan said. "We won't allow the people to be devoured by YouTube, Facebook or others. Whatever steps need to be taken we will take them without wavering."

Asked if the steps could include shutting those sites down, Erdoğan reportedly replied: "That included. Because these people or institutions are [using social media] for all kinds of immorality, all kinds of espionage and spying."

Following his speech, Erdoğan's office said in a statement that Erdoğan was referring to what it called Twitter's failure to implement Turkish court orders seeking the removal of some links and that they may be left with no option but to ban the platform.

"If Twitter officials insist on not implementing court orders and rules of law ... there will be no other option but to prevent access to Twitter to help satisfy our citizens' grievances," the statement said.

Turkish internet users were quick to come up with their own ways to circumvent the block. The hashtag #TwitterisblockedinTurkey quickly moved among the top trending globally.

The disruption sparked a virtual uproar with many comparing Turkey to Iran and North Korea, where social media platforms are tightly controlled. There were also calls to take to the street to protest, although some users equally called for calm.

Nazli Ilicak, a columnist who used to work for the pro-government Sabah newspaper described the move as "a civil coup" in an interview on broadcaster CNN Turk.