Turkey's parliament on Wednesday passed a controversial bill which gives the government greater control of social media, the official Anadolu news agency reported.

Under the new law, social media giants such as Facebook and Twitter have to ensure they have local representatives in Turkey and to comply with court orders over the removal of certain content or face heavy fines.

Critics are concerned about the legislation's impact on freedom of speech.

The law targets social networks with more than a million unique visits every day and says servers with Turkish users' data must be stored in Turkey.

It was submitted by the ruling AKP and its nationalist partner the MHP, which have a majority in the parliament, and passed after debates beginning on Tuesday and lasting into Wednesday.

Human rights groups and the opposition are worried over what they call the erosion of freedom of expression in Turkey, with thousands of people subject to criminal proceedings for "insulting" President Recep Tayyip Erdogan on social media.

They argue that increased control of social media will also limit Turkish access to independent or critical information in a country where the news media is in the hands of government-friendly businessmen or controlled by the state.

"Why now? asked Yaman Akdeniz, professor at Istanbul's Bilgi University and also a cyber rights expert.

"While print and broadcast media platforms are already under government control, social networks are relatively free.

"Social networks have become one of the few spaces for free and effective expression in Turkey," he told AFP.

'Dark era'

Human Rights Watch expressed concerns that the law would enable the government to control social media, to get content removed at will and to arbitrarily target individual users.

"Social media is a lifeline for many people who use it to access news, so this law signals a new dark era of online censorship," said Tom Porteous, deputy program director at Human Rights Watch in a statement before the legislation passed.

Erdogan vowed to tighten government control over social media earlier this month after he said "dark-hearted" users insulted Finance Minister Berat Albayrak and his wife Esra, the president's daughter, following the birth of their fourth child.

The president is not a fan of social media despite a large following on different platforms, including Twitter. He once compared the media platforms to a "murderer's knife".

A Turkish court in January lifted a ban on the online encyclopedia Wikipedia after almost three years.

According to Twitter's latest "transparency report" for the first half of 2019, Turkey ranked number one for seeking content removal with more than 6,000 requests.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.