MEPs, EU officials and diplomats from the member states have agreed compromise legislation to assist print publishers, artists and music producers get a “fair return” for the online dissemination of their work. The legislation reforms European copyright law for the first time in two decades and, supporters say, brings it into the digital age.

The final deal, the result of a “trialogue” negotiation, a reconciliation process between the EU institutions, is the culmination of a lengthy process involving heavy lobbying by the industries involved and acrimonious parliamentary debates.

After the legislation is formally passed by MEPs and the member states, US tech giants such as Google will have to negotiate licensing agreements with rights holders – such as record companies, collecting societies and media companies – to publish their content on YouTube and Google News, and scan its video-sharing platform to remove copyright-protected content that falls under these deals. (Google already uses content recognition technology called Content ID.)

Deal welcomed The deal was welcomed by Europe’s press publishers, represented by EMMA (European Magazine Media Association), ENPA (European Newspaper Publishers’ Association), EPC (European Publishers Council) and NME (News Media Europe).

A spokesman said: “Quality journalism is at the heart of our democracies, and if we want a future for professional journalism in the European Union, we must take action to support the press and to redress an unbalanced ecosystem.”

“The agreement is not everything the parliament wanted to achieve, nor is it everything the council and the commission wanted, but I think we met the thin lines everyone can agree on,” the lead negotiator for the European Parliament, Axel Voss, said after the compromise was reached.

“Europeans will finally have modern copyright rules fit for the digital age with real benefits for everyone,” commissioner for the digital economy Andrus Ansip told journalists. He spoke of the need to reconcile the right ta a fair return on work with the interest publishers had in the wide access provided by digital platforms to such work – that meant sharing the ad revenue earned by platforms and that had traditionally been a key source of revenue to the print industry.

The reform also creates a mandatory exception to copyright rules for text and data mining: short extracts, the use of copyright material in memes and hyphenated text links will also not attract charges.

Online encyclopaedias The legislation also specifies that uploading works to online encyclopaedias in a non-commercial way, such as Wikipedia, or open-source software platforms, such as GitHub, will automatically be excluded. Start-up platforms will be subject to lighter obligations than more established ones.

“This deal contains numerous provisions which will guarantee that the internet remains a space for free expression,” Mr Voss said.

“These provisions were not in themselves necessary, because the directive will not be creating any new rights for rights holders. Yet we listened to the concerns raised and chose to doubly guarantee the freedom of expression. The ‘meme’, the ‘gif’, the ‘snippet’ are now more protected than ever before.”

One of the most controversial elements of the overhaul, article 13, is designed to make platforms more responsible for taking down user-generated content that breaks copyright law. YouTube has warned this may mean millions of videos will become unavailable in Europe.