Turkey's defiant Prime Minister Recep Tayyip Erdogan launched a blistering new attack on social media on Sunday after his government banned Twitter just days before crucial local elections. "I cannot understand how sensible people still defend Facebook, YouTube and Twitter. They run all kinds of lies," he declared at an election rally. His fresh diatribe came shortly after President Abdullah Gul voiced hope the government would soon lift the Twitter ban, which has been roundly condemned as a bid to muzzle a widening corruption scandal dogging the government. "I believe this problem will be over soon," Gul told reporters. "This is of course an unpleasant situation for such a developed country as Turkey, which has weight in the region and which is negotiating with the European Union." The conflicting comments underscore what appears to be a growing gulf between the two men before Turks vote in local elections on March 30. Erdogan also lashed out on Sunday at Facebook and YouTube which he has also threatened to ban after the polls, accusing them of advocating freedom selectively across the globe. "Twitter, Facebook and YouTube have to respect the Turkish republic's laws," he said. "Turkey is not a banana republic." He said Twitter abided by national laws in countries such as the United States, Britain, China and Russia but that when it came to countries such as Turkey or Egypt "Twitter talks about freedom". Erdogan is seen by critics as increasingly authoritarian after his Islamic-rooted government introduced curbs on the Internet and tightened its control on the judiciary in the wake of the graft probe that has ensnared members of his inner circle. Social media networks have been flooded almost daily with recordings allegedly showing Erdogan talking with his son about hiding vast sums of money and interfering in court cases, business deals and media coverage. Erdogan has dismissed the recordings as "vile" fakes concocted by his political rivals, including US-based cleric Fethullah Gulen, once a staunch ally. "If the US president's phone recordings go online, will Twitter, YouTube and Facebook say it is freedom?" he said Sunday. Erdogan, who has been in power for 11 years, said he was obliged to act to counter "any attack threatening my country's security". "If Twitter acts honestly, we are ready to support it. If YouTube acts honestly, we are ready to give every support. If Facebook gives up immoralities... it will receive support," he added. The government said Twitter had failed to abide by hundreds of court orders to remove content deemed illegal. - '21st-century book burning' - In the run-up to the elections, Erdogan and his Islamic-rooted Justice and Development Party (AKP) are also struggling to shake off the after-effects of mass anti-government protests last year that were organised partly on Twitter, prompting Erdogan to label the site a "menace". "Blocking access to Twitter is the work of a government which is losing its self-confidence and strength," veteran journalist Kadri Gursel wrote in the Milliyet newspaper. The ban has added to concern among rights groups and Turkey's Western allies about basic freedoms and rights in a country that has jailed more reporters than any other country, including serial offenders Iran, China and Eritrea. Douglas Frantz, assistant secretary of public affairs at the US State Department, described the Twitter ban as "21st-century book burning" and said it should be reversed. "A friend like Turkey has nothing to fear in the free-flow of ideas and even criticism represented by Twitter," he wrote in an official blog. Frustrated Turks have been able to access the US-based site by tweeting via text message or tweaking their Internet settings. Methods include changing their domain name system (DNS) settings or using a virtual private network (VPN). But since Saturday there have been unconfirmed reports the government is trying to block access to lists of alternative DNS numbers. Gul, a frequent social media user, took to Twitter on Friday to denounce the ban. The president, who co-founded the AKP with Erdogan, has emerged as a more conciliatory leader than the Turkish premier. But he also drew criticism last month for signing a controversial AKP-sponsored law to tighten government control over the Internet. Gul said Sunday it was "not legally possible" in Turkey to shut down the Internet or access to platforms such as Twitter. He also confirmed that Twitter had hired a lawyer in Turkey for negotiations with the authorities.