Turkey strengthened its ban on Twitter over the weekend. But even though the Turkish government voted last month to expand its ability to censor the site, some legal experts cast doubt on the legality of Prime Minister Recep Tayyip Erdogan's recent actions -- and questioned whether the move was designed to censor information days before a key local election.

The Turkish parliament voted Feb. 5 to amend Law No 5651 -- the regulation governing online communication -- and to give the government greater power to control what its citizens see on the Internet. A report on the draft version of that legislation from the Organization for Security and Co-operation in Europe warned  that "the amendments to protect individual rights and privacy will result in new blocking measures while leaving unfettered discretion to the administration."

But government censorship of the Internet is not a new phenomenon in Turkey. Since law No 5651 was enacted in May of 2007, "access to almost 40,000 Web sites were blocked from Turkey," according to Yaman Akdeniz, a law professor at Istanbul Bilgi University. "The current version includes even wider power for both the courts of law and TIB, an administrative body to block access to Internet content."

"There is no legal measure that justifies the current access blocking of Twitter.com Web site from Turkey"

TIB is the Turkish Telecommunications Presidency, and it typically enforces blocking measures -- including this one on Twitter. But in this case, Akdeniz says, TIB has overstepped what is allowable even under the new expansion of government powers. "There is no legal measure that justifies the current access-blocking of Twitter.com Web site from Turkey," he told The Washington Post. "TIB acted unilaterally and outside the scope of Law No 5651, which grants TIB certain authority to issue administrative blocking orders."

Other Turkish legal experts question the legality of the ban, as well, including the Union of Turkish Bar Associations, which filed a petition challenging the ban in the Istanbul Heavy Penal Court late last week. The head of that organization, Metin Feyzioğlu, told the Daily Hurriyet: “A total ban on Twitter access is a violation of the European Convention on Human Rights, the Turkish Constitution and Law 5651 that includes Internet regulations."

There does not appear to be a court order requiring the blocking of the entirety of Twitter.com, according to legal experts and local media. While the page that Turkish users saw when they tried to visit Twitter cites various judicial orders, none appears to call for the removal of the entire platform -- just specific content. The court rejected the union's petition on Friday, but its decision did confirm the ban was the result of an "executive decision" rather than a judicial ruling.

The government's justification

The Turkish telecommunications agency defended the government's action to block access to Twitter, saying that because the social network had not implemented local court orders related to removing specific content,TIB was forced to take matters into its own hands. According to local media reports, Erdogan's administration claims that hundreds of court orders have been ignored by the service since January, but only four notices show up in a government database that tracks Turkish online enforcement actions.

The first court decision was dated Feb. 3. Court documents obtained by The Post show that it involved the alleged online impersonation of Turkish poet İsmet Özel. Local reports corroborate that the order called for the removal of fake accounts.

The next court order came March 4 and appears to involve the posting of explicit material in association with the name of a local Turkish woman on Twitter according to local media reports. The material was allegedly an  attempt to call into question the woman's character, the reports said. The prime minister himself appeared to confirm this account in a public speech Sunday, referring to a housewife who was smeared with pornography on Twitter to justify the nationwide ban.

At least one local report said the material has since been removed from Twitter, which appears to be the case from the Washington Post's investigation, although it is unclear if the content was removed before or after the Turkish Twitter ban went into effect.

A spokesperson for Twitter declined to comment, saying it is against policy to comment on individual accounts. However, given the descriptions of the offensive content, it seems likely the material in question would have qualified for removal under Twitter's own rules regardless of the current ban.

Many local media reports about this case quoted a lawyer for the Turkish woman saying that they neither asked for nor were granted a court order requiring the blocking of the entire Twitter platform.

The protection measure from the Istanbul chief prosecutor's office

Another protection measure appears to have stemmed from the Istanbul chief prosecutor's office and was dated March 7, according to the notices in the Turkish government database. (Earlier versions of this notice dated the action to March 20, but that appears to have changed.)

The case originated from a court that investigates terror cases, and the case number was cited in a February press release from the chief prosecutor's office about a terror-related wiretapping investigation covered by local media.

The case number appeared again in a column in a local paper, Today's Zaman, along with rumors that the government was trying to cover up that the investigation had found Iranian agents within the Turkish government -- and a link to a Twitter account with over 100,000 followers that is allegedly leaking information about the investigation.

Conspiracy theories are relatively common in Turkey, and the veracity of the leaks is unclear. But given the link between the case number and the prominent Twitter account, it seems plausible that the prosecutor's office took action to close down an account interfering with an investigation.

Stopping corruption rumors?

The last protection order cited by the government, however, relates to alleged corruption involving Erdogan's  administration and his party. As previously reported by The Post, the case involved claims of defamation by former Minister Binalı Yıldırım and his son about posts from a Twitter account and blog.  Online leaks have allegedly implicated Yıldırmin in an ongoing corruption scandal that has engulfed his party -- and Erdogan. But Yıldırmin remains a mayoral candidate in local elections that are only days away.

It's these elections that some believe prompted the Twitter ban. "The only explanation I have [for the Twitter ban] is that the prime minister wanted Twitter to be blocked from Turkey nine days prior to crucial local elections and TIB somehow found a solution, albeit an illegal one," said Akdeniz.

"Erdogan likely still has enough supporters to win elections, but to continue to win, he needs to keep them off social media," wrote Zeynep Tufekci, a Turkish sociology professor at the University of North Carolina, in blog post that cited Erdogan's use of the housewife example to connect with his base.

"His game is to scare them about all that comes from social media," Tufekci wrote. "He knows they’ll hear of the corruption tapes. But they are now associated with the same source that maligns housewives as porn-stars." By tainting the source, Tufekci wrote, Erdogan hopes to discredit them and maintain his grip on power.

"The battle is for the hearts and minds of Erdogan’s own supporters, and whether Erdogan can convince them that social media is a dangerous, uncontrolled, filthy place from which nothing good can come," Tufekci wrote.

The next battle

And it's a battle that isn't over yet. While local reports said Twitter has hired legal representation to fight the ban on the ground, the Wall Street Journal reported that Youtube refused to remove content related to the alleged corruption scandal -- potentially opening up another digital battleground.

Turkey has blocked Youtube before. And Erdogan threatened the video site and Facebook in the same speech where he mentioned the housewife case Sunday, saying that “if they don’t obey our laws, we will do what’s necessary" according to local media reports.

“Twitter, Facebook, YouTube -- can they say ‘freedom’ if they publish the confidential conversations of the U.S. president?" Erdogan asked. "They can’t. Do they remember freedom when it comes to Turkey?"

The United States has condemned Erdogan's actions, with both the White House and the State Department weighing in on the ban.

Meanwhile in Turkey, President Abdullah Gül, who is from the same party as Erdogan, criticized the ban over the weekend, questioning its legality and saying that he had ordered his staff to help end the situation.  Likewise, Kemal Kılıcdaroglu, the leader of an opposition party, slammed Erdogan during a campaign rally over the weekend, saying that the prime minister was "afraid of 140 characters," according to local media reports.

Correction: An earlier version of this story misspelled the last name of Law professor Yaman Akdeniz in his final quote. We regret the error.