Social networks that fail to remove defamatory “fake news”, hate speech and other illegal content will be fined up to €50m (£43m) under new plans agreed by the German government.

Angela Merkel’s cabinet voted on the measures amid concerns over free speech, with campaigners, technology firms and journalists raising fears that tightened regulations could restrict expression.

Heiko Maas, the German justice minister, vowed to push for similar rules Europe-wide, adding: “There should be just as little tolerance for criminal incitement on social networks as on the street.

Trump calls leak "fake news" and "something that Nazi Germany would have done"

“We owe it to the victims of hate crime to manage this better.”

The bill strengthens Germany’s existing laws covering hate speech, slander, defamation, threats and incitement, adding to prison sentences already enforceable for Holocaust denial or inciting hatred against minorities.

The issue has taken on increasing urgency ahead of the country’s federal elections in September, with concerns the proliferation of “fake news” and racist content online could affect the outcome.

Fears over terror attacks claimed by Isis have been a point of contention, as has the reaction to the arrival of more than 1 million refugees in Germany over the past two years.

Facebook won a court case last month after a Syrian refugee falsely accused of being a terrorist and attempted murderer in a series of xenophobic posts attempted to sue the social networking giant for damages.

Anas Modamani, whose chance selfie with Ms Merkel is one of a series of images seized upon by far-right groups, argued that failure to remove the posts put him at risk.

His lawyer pointed out that Facebook’s community standards violations did not include libel, which is a criminal offence in Germany, the UK and elsewhere.

A photo of Anas Modamani taking a selfie with Angela Merkel went viral after it was used by news organisations around the world (Getty) (Getty Images)

The new law would give social networks 24 hours to delete or block criminal content and seven days to deal with less clear-cut cases, with an obligation to report back to the person who filed the complaint about how it was handled.

Failure to comply could see a company fined up to €50m (£43m), with its chief representative in Germany handed an additional penalty of €5m (£4.3m).

The Digital Society Association was among the groups opposing the move, with its head Volker Tripp saying: “It is the wrong approach to make social networks into a content police.”

Bitkom, an association that represents digital companies, said the government should build up specialist teams to monitor online content for potential infringements, rather than expect social networks to do it themselves.

“Given the short deadlines and the severe penalties, providers will be forced to delete doubtful statements as a precaution,’ said Bitkom manager Bernhard Rohleder.

“That would have a serious impact on free speech on the internet.”

Since it was unveiled last month, the draft law has been amended to include new categories of content, such as child pornography and now allows courts to order social networks to reveal the identity of the user behind criminal posts.

To address concerns over free speech, the legislation was tweaked to make clear that a fine would not necessarily be imposed after just one infraction, and still needs to be approved by the Bundestag.

Refugees settle in Germany Show all 12 1 /12 Refugees settle in Germany Refugees settle in Germany Germany Mohamed Zayat, a refugee from Syria, plays with his daughter Ranim, who is nearly 3, in the one room they and Mohamed's wife Laloosh call home at an asylum-seekers' shelter in Vossberg village on October 9, 2015 in Letschin, Germany. The Zayats arrived approximately two months ago after trekking through Turkey, Greece and the Balkans and are now waiting for local authorities to process their asylum application, after which they will be allowed to live independently and settle elsewhere in Germany. Approximately 60 asylum-seekers, mostly from Syria, Chechnya and Somalia, live at the Vossberg shelter, which is run by the Arbeiter-Samariter Bund (ASB) charity 2015 Getty Images Refugees settle in Germany Germany A refugee child Amnat Musayeva points to a star with her photo and name that decorates the door to her classroom as teacher Martina Fischer looks on at the local kindergarten Amnat and her siblings attend on October 9, 2015 in Letschin, Germany. The children live with their family at an asylum-seekers' shelter in nearby Vossberg village and are waiting for local authorities to process their asylum applications. Approximately 60 asylum-seekers, mostly from Syria, Chechnya and Somalia, live at the Vossberg shelter, which is run by the Arbeiter-Samariter Bund (ASB) charity Getty Images Refugees settle in Germany Germany Kurdish Syrian asylum-applicant Mohamed Ali Hussein (R), 19, and fellow applicant Autur, from Latvia, load benches onto a truckbed while performing community service, for which they receive a small allowance, in Wilhelmsaue village on October 9, 2015 near Letschin, Germany. Mohamed and Autur live at an asylum-applicants' shelter in nearby Vossberg village. Approximately 60 asylum-seekers, mostly from Syria, Chechnya and Somalia, live at the Vossberg shelter, which is run by the Arbeiter-Samariter Bund (ASB) charity Getty Images Refugees settle in Germany Germany Mohamed Ali Hussein ((L), 19, and his cousin Sinjar Hussein, 34, sweep leaves at a cemetery in Gieshof village, for which they receive a small allowance, near Letschin Getty Images Refugees settle in Germany Germany Mohamed Zayat, a refugee from Syria, looks among donated clothing in the basement of the asylum-seekers' shelter that is home to Mohamed, his wife Laloosh and their daughter Ranim as residents' laundry dries behind in Vossberg village on October 9, 2015 in Letschin, Germany. The Zayats arrived approximately two months ago after trekking through Turkey, Greece and the Balkans and are now waiting for local authorities to process their asylum application, after which they will be allowed to live independently and settle elsewhere in Germany Getty Images Refugees settle in Germany Germany Asya Sugaipova (L), Mohza Mukayeva and Khadra Zhukova prepare food in the communal kitchen at the asylum-seekers' shelter that is their home in Vossberg village in Letschin Getty Images Refugees settle in Germany Germany Efrah Abdullahi Ahmed looks down from the communal kitchen window at her daughter Sumaya, 10, who had just returned from school, at the asylum-seekers' shelter that is their home in Vossberg Getty Images Refugees settle in Germany Germany Asylum-applicants, including Syrians Mohamed Ali Hussein (C-R, in black jacket) and Fadi Almasalmeh (C), return from grocery shopping with other refugees to the asylum-applicants' shelter that is their home in Vossberg village in Letschin Getty Images Refugees settle in Germany Germany Mohamed Zayat (2nd from L), a refugee from Syria, smokes a cigarette after shopping for groceries with his daughter Ranim, who is nearly 3, and fellow-Syrian refugees Mohamed Ali Hussein (C) and Fadi Almasalmeh (L) at a local supermarket on October 9, 2015 in Letschin, Germany. All of them live at an asylum-seekers' shelter in nearby Vossberg village and are waiting for local authorities to process their asylum applications, after which they will be allowed to live independently and settle elsewhere in Germany 2015 Getty Images Refugees settle in Germany Germany Kurdish Syrian refugees Leila, 9, carries her sister Avin, 1, in the backyard at the asylum-seekers' shelter that is home to them and their family in Vossberg village in Letschin Getty Images Refugees settle in Germany Germany Somali refugees and husband and wife Said Ahmed Gure (R) and Ayaan Gure pose with their infant son Muzammili, who was born in Germany, in the room they share at an asylum-seekers' shelter in Vossberg village on October 9, 2015 in Letschin, Germany. Approximately 60 asylum-seekers, mostly from Syria, Chechnya and Somalia, live at the Vossberg shelter, which is run by the Arbeiter-Samariter Bund (ASB) charity, and are waiting for authorities to process their application for asylum 2015 Getty Images Refugees settle in Germany Germany German Chancellor Angela Merkel pauses for a selfie with a refugee after she visited the AWO Refugium Askanierring shelter for refugees in Berlin Getty Images

Mr Maas said freedom of expression was “of huge importance” in Germany, but that “freedom of expression ends where criminal law begins”.

The justice ministry said research showed that Facebook deleted just 39 per cent of content reported by users and Twitter only 1 per cent, despite signing a code of conduct in 2015 that included a pledge to delete hate speech within 24 hours.

The cabinet also approved a new law cracking down on the recognition of child marriage among arriving refugees on Wednesday.

It proposes automatically declaring certificates void if one of the partners was under the age of 16 when they wed, despite concerns that the move would leave young female asylum seekers and those with children vulnerable.

In principle, marriages involving under-18s will also not be recognised, but courts will be allowed to decide whether to annul them on a case-by-case basis after receiving advice from youth protection agencies.

Cabinet members agreed the measure as a newspaper report claimed that about 270,000 Syrians living in Germany have the right to bring their family members into the country.

Bild’s report could add fuel to the raging debate about migration less than six months before national elections, where Ms Merkel is seeking a fourth term as Chancellor.