The German parliament has passed a law aimed at cracking down on hate speech on social media, which critics say could have drastic consequences for free speech online.
The measure is designed to enforce the country's existing limits on free speech, including the long-standing ban on Holocaust denial.
Among other things, it would fine social networking sites up to 50 million euros (£44 million) if they persistently fail to remove illegal content within a week, including defamatory "fake news".
Justice Minister Heiko Maas argued that social media networks have failed to prevent their sites from being used to spread inflammatory views and false information.
Human rights experts and internet companies said the law risks privatising the process of censorship and could have a chilling effect on free speech.
"Freedom of speech ends where the criminal law begins," said Mr Maas, who was the driving force behind the bill.
He said official figures showed the number of hate crimes in Germany had increased by over 300% in the last two years.
Social media platforms such as Facebook, Google and Twitter have become a battleground for angry debates about Germany's recent influx of more than a million refugees, with authorities struggling to keep up with the flood of criminal complaints.
Mr Maas claimed 14 months of discussion with major social media companies had made no significant progress.
Last week, legislators from his Social Democratic Party and Chancellor Angela Merkel's centre-right Union bloc agreed a number of amendments to give companies more time to check whether posts flagged to them are illegal, delegate the vetting process to a third party and ensure that users whose comments are removed can appeal against the decision.
"This law as it stands now will not improve efforts to tackle this important societal problem," Facebook said in a statement.
"We feel that the lack of scrutiny and consultation do not do justice to the importance of the subject. We will continue to do everything we can to ensure safety for the people on our platform," the company said, noting that it is hiring 3,000 additional staff on top of 4,500 already working to review posts.
Aside from the hefty fine for companies, the law also provides for fines of up to 5 million euros (£4.4 million) for the person each company designates to deal with the complaints procedure if it does not meet requirements.
Social networks also have to publish a report every six months detailing how many complaints they have received and how they dealt with them.
Among those welcoming the law was Germany's main Jewish organisation, which called it a "strong instrument against hate speech in social networks".
Germany has long had a law criminalising Holocaust denial - a response to the country's Nazi-era history of allowing racist ideas to become genocidal policy.
"Jews are exposed to anti-Semitic hatred in social networks on a daily basis," the Central Council of Jews said.
"Since all voluntary agreements with platform operators produced almost no result, this law is the logical consequence to effectively limit hate speech."
The nationalist Alternative for Germany party, which has frequently been accused of whipping up sentiment against immigrants and minorities, said it is considering challenging the law in Germany's highest court.