A Turkish court banned access to popular social media sites that posted images last week showing a prosecutor being held hostage by gunmen. But, the restrictions are the latest crackdown on social media, just two months before a general election.]]

A Turkish court blocked access to popular social media sites Twitter, Facebook and the Internet site You Tube. The ban is in response to the failure of the sites to remove images posted of a Turkish prosecutor being held a gunpoint last week after being kidnapped by two members of a banned radical left-wing group. The prosecutor was later killed as police were attempting to rescue him.

Twitter and Facebook saw the ban lifted after they complied with the court order and removed the images. You Tube currently remains banned. The Google website is now also reportedly facing the threat of closure over access to the images.

Turkish authorities claim the images of the prosecutor, which were widely broadcast on Turkish media and the Internet, support terrorism and have caused distress to his family. According to a Turkish media report, a court also has banned over 150 local Internet sites for showing the offending images. But the banning of Twitter and You Tube, which are hugely popular in Turkey, has caused anger and concern in the country.

Yaman Akdeniz, an expert on cyber freedom at Istanbul’s Bilgi University, says the timing of the ban, just before June's general election, is worrying.

"To be honest, I am not surprised or shocked at all; this was expected - expected prior to the elections. And the only thing we weren’t sure was when and why it was going to happen, and now it happened. Despite two major constitutional court decisions last year involving Twitter and You Tube, they still blocked access to social media platforms," said Akdeniz.

In 2014, a similar ban was imposed just before local elections for postings accusing the government of corruption, drawing national and international condemnation just before local elections. The constitutional court eventually overturned that ban, citing the constitutional right to access social media, which are used extensively by opponents of the government.

Concern about Internet freedom in Turkey has grown since the government passed legislation last month empowering ministers to remove websites within two hours without a court order.

Human rights groups also have voiced alarm at what they say is a marked increase in prosecutions of people who have posted criticisms of the government and, in particular, President Recep Tayyip Erdogan.

A 16-year-old school boy is currently on trial for insulting a public official after he used social media to criticize the president. If convicted, he could face a jail sentence. In March, police removed a 13-year-old boy from his class for a similar posting critical of the president.