The European Parliament has passed the Copyright Directive, a controversial new law that will make tech companies liable for copyright-infringing content hosted on their platforms, against the warnings of campaigners who say that the law risks chilling free speech online.

The Copyright Directive was passed by the European Parliament with 348 votes to 274. It must still be approved by the Council of the European Union, a body of 28 representatives (or 27 minus the U.K.) of the E.U. member states. After approval, the law must be implemented by the member states.

The legislation includes two controversial articles, one of which requires tech companies to obtain permission from rights-holders (or at least make the best possible effort to obtain it) before copyrighted content is uploaded to their platform. In practice, this means that tech platforms will have to develop costly and elaborate systems to detect when users are trying to upload copyrighted content. This will be a major burden for smaller companies, and a major advantage for large ones, like YouTube, which has already developed such a system.

A second article in the legislation, dubbed the “link tax,” will force tech platforms to pay a fee to news companies when they use snippets of their articles in aggregators like Google News. This aspect of the legislation was strongly supported by elements of the mainstream media, which has long seen big tech as a threat to its business model.

Fabrice Fries, CEO of Associated Free Press, welcomed the link tax, saying it can “help to maintain journalism in the field, which all evidence shows is still the best way to combat misinformation.”

Opposition to the copyright led to an unlikely agreement between tech giants and the very populist right-wingers that the platforms frequently censor to appease left-wing critics. Tech platforms like Google and Reddit opposed the copyright directive, but so too did European populist parties like the UK Independence Party, which includes members like Tommy Robinson and Michael Meecham (a.k.a “Count Dankula”), both of whom have been censored and demonetized by major tech platforms.

“This is an attack on freedom of speech and expression, to benefit only large corporations” said Meecham, who became a rallying point for free speech after the Scottish government put him on trial for “hate speech” over a comedy video.

A list will be compiled of the MEP's and parties who voted in favour of censoring the internet, when the next election comes, these people deserve to lose their seats. This is a direct attack on freedom of speech and expression, to benefit only large corporations.#Article13 — Count Dankula🏴 (@CountDankulaTV) March 26, 2019

In another tweet, Meecham compared the EU’s emerging internet-policing regime to China’s.

Hey, did you guys know there is another country that has an internet filter that decides what information the population can and can't see?#Article13 pic.twitter.com/kuqJSnffAY — Count Dankula🏴 (@CountDankulaTV) March 26, 2019

MEP Julia Reda, who opposed the law, called its passage a “dark day for internet freedom.”

Dark day for internet freedom: The @Europarl_EN has rubber-stamped copyright reform including #Article13 and #Article11. MEPs refused to even consider amendments. The results of the final vote: 348 in favor, 274 against #SaveYourInternet pic.twitter.com/8bHaPEEUk3 — Julia Reda (@Senficon) March 26, 2019

Google offered a more lukewarm statement, welcoming changes to the legislation since it was first introduced last year, but warning that it will hurt Europe’s “creative and digital economies.”

The E.U. copyright directive is improved but will still lead to legal uncertainty and will hurt Europe’s creative and digital economies,” a company spokesperson told The Guardian. “The details matter, and we look forward to working with policymakers, publishers, creators and rights holders as EU member states move to implement these new rules.”

Allum Bokhari is the senior technology correspondent at Breitbart News. You can follow him on Twitter, Gab.ai and add him on Facebook. Email tips and suggestions to allumbokhari@protonmail.com.