The European Union could fine big tech companies billions of pounds as part of a new landmark deal to tackle hate speech, disinformation, and other harmful online content.
The new Digital Services Act will force companies including Facebook, Google, and Amazon to police themselves harder and make it easier for users to flag problems.
EU officials finally clinched the deal in the early hours of Saturday morning, and they will impact all 27 member states.
"With the DSA, the time of big online platforms behaving like they are 'too big to care' is coming to an end," said EU Internal Market Commissioner Thierry Breton.
EU Commission Vice President Margrethe Vestager added that "with today's agreement we ensure that platforms are held accountable for the risks their services can pose to society and citizens."
The law is a significant contrast with regulations in the US, where Silicon Valley lobbyists have largely succeeded in keeping federal lawmakers at bay.
The EU's new rules, which are designed to protect internet users and their "fundamental rights online," should make tech companies more accountable for content created by users and amplified by their platforms' algorithms.
The need to regulate online platforms came into focus following the 2016 US election when Russia was found to have used targeted adverts on social media to influence voters.
Facebook and Twitter promised to crack down on misinformation but during the COVID-19 pandemic this only blossomed, and anti-vaccine falsehoods continued to thrive.
Under the EU law, governments would be able to request companies take down a wide range of content that would be deemed illegal, including material that promotes terrorism, child sexual abuse, hate speech and commercial scams.
Social media platforms like Facebook and Twitter would have to give users tools to flag such content in an "easy and effective way" so that it can be swiftly removed.
Online marketplaces like Amazon would have to do the same for dodgy products, such as counterfeit sneakers or unsafe toys.
It also bands adverts targeted at minors and those targeted at users based on their gender, ethnicity, and sexual orientation.
Tech giants had been lobbying officials in Brussels to get them to water down the rules.
To enforce them, the European Commission is expected to hire more than 200 new staffers. To pay for it, tech companies will be charged a "supervisory fee," which could be up to 0.1% of their annual global net income, depending on the negotiations.
Twitter said Saturday it would review the rules "in detail" and that it supports "smart, forward-thinking regulation that balances the need to tackle online harm with protecting the Open Internet."
Google said in a statement on Friday that it looks forward to "working with policymakers to get the remaining technical details right to ensure the law works for everyone".
Amazon referred to a blog post from last year that said it welcomed measures that enhance trust in online services.
Facebook has not yet publicly commented.
"The big tech firms will heavily resist other countries adopting similar rules, and I cannot imagine the firms voluntarily applying these rules outside the EU,", said Zach Meyers, a senior research fellow at the Centre for European Reform think tank.