BRUSSELS (Reuters) - The European Union is set to rewrite its two-decades-old copyright rules which will force Alphabet Inc’s Google and Facebook Inc to share revenue with the creative industries and remove copyright-protected content on YouTube or Instagram.

FILE PHOTO: A European Union flag is seen outside the EU Commission headquarters in Brussels, Belgium November 14, 2018. REUTERS/Francois Lenoir/File Photo

Negotiators from the EU countries, the European Parliament and the European Commission clinched a deal after day-long negotiations.

The commission, the EU’s executive body, launched the debate two years ago, saying the rules needed to be overhauled to protect the bloc’s cultural heritage and make sure that publishers, broadcasters and artists are remunerated fairly.

“Agreement reached on #copyright! Europeans will finally have modern copyright rules fit for digital age with real benefits for everyone: guaranteed rights for users, fair remuneration for creators, clarity of rules for platforms,” EU digital chief Andrus Ansip said in a tweet.

Under the new rules, Google and other online platforms will have to sign licensing agreements with rights holders such as musicians, performers, authors, news publishers and journalists to use their work online.

Google’s YouTube and Facebook’s Instagram and other sharing platforms will be required to install upload filters to prevent users from uploading copyrighted materials.

Google, which has lobbied intensively against both features and even suggested that it may pull Google News from Europe, said it would study the text before deciding on its next steps.

“Copyright reform needs to benefit everyone - including European creators and consumers, small publishers and platforms ... The details will matter,” the company said in a tweet.

Spain and Germany in recent years tried to force Google to pay publishers for taking snippets of their news articles, but that backfired after Google News pulled out from Spain and traffic of German publisher Axel Springer plunged after it sought to block the search engine.

EU lawmaker Axel Voss said it was time internet giants pay their dues to rights holders.

“This deal is an important step toward correcting a situation which has allowed a few companies to earn huge sums of money without properly remunerating the thousands of creatives and journalists whose work they depend on,” he said.

However, lawmaker Julia Reda from the Pirate Party voiced concerns, saying that algorithms in upload filters cannot tell the difference between copyright infringements and legal parodies.

“Requiring platforms to use upload filters would not just lead to more frequent blocking of legal uploads, it would also make life difficult for smaller platforms that cannot afford filtering software,” she said.

Online platforms in existence for less than three years and with less than 10 million euros in revenue and fewer than 5 million monthly users are exempted from installing upload filters.

Nonprofit bodies, online encyclopedias such as Wikipedia, and open source software platforms such as GitHub will be able to use potentially valuable data for research and educational purposes without being subjected to the copyright rules.

European consumer organization BEUC expressed disappointment.

“It will become much harder for users to share their own, non-commercial music, video or photo creations online. This reform is not based on the reality of how people use the internet,” its deputy director general, Ursula Pachl, said.

The European Magazine Media Association, European Newspaper Publishers’ Association, European Publishers Council and News Media Europe gave a thumbs-up to the revamp.

“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,” they said in a joint statement.

The agreement needs approval from the European Parliament and EU countries before it can become law. That is expected to be a formality.