Copyright laws which critics say could change the internet have been voted in by the European Parliament.
The new rules, including the controversial Article 13, will hold tech firms responsible for material posted without copyright permission.
Sharing memes and GIFs will still be allowed under the new laws.
Many musicians and creators say the legislation will compensate artists fairly – but others argue that they will destroy user-generated content.
Copyright is the legal right that allows an artist to protect how their original work is used.
Tech companies have argued that artists are already paid fairly under the current system. Google said it would “harm Europe’s creative and digital industries”.
High-profile figures who have campaigned against the EU Copyright Directive include Wyclef Jean and web inventor Sir Tim Berners Lee, while Debbie Harry and Sir Paul McCartney have been among its supporters.
It has taken several revisions for the current legislation, which was was backed by 348 MEPs, with 278 against, to reach its final form.
It is now up to member states to approve the decision. If they do, they will have two years to implement it once it is officially published.
The two clauses causing the most controversy are known as Article 11 and Article 13.
Article 11 states that search engines and news aggregate platforms should pay to use links from news websites.
Article 13 holds larger technology companies responsible for material posted without a copyright licence. Tech companies already remove music and videos which are copyrighted, but under the new laws they will be more liable for any copyrighted content.
It means they would need to apply filters to content before it is uploaded.
Article 13 does not include cloud storage services and there are already existing exemptions, including parody, which, for example, includes memes.
It was Article 13 which prompted fears over the future of memes and GIFs – stills, animated or short video clips that go viral – since they mainly rely on copyrighted scenes from TV and film.
Critics claimed Article 13 would have made it nearly impossible to upload even the tiniest part of a copyrighted work to Facebook, YouTube, or any other site.
However, specific tweaks to the law made earlier this year made memes safe “for purposes of quotation, criticism, review, caricature, parody and pastiche”.
The European Parliament said that memes would be “specifically excluded” from the directive, although it was unclear how tech firms would be able to enforce that rule with a blanket filter.
MEP for London Mary Honeyball said: “There’s no problem with memes at all. This directive was never intended to stop memes and mashups.
“I think that’s doom-mongering. People who carry out their business properly have nothing to worry about at all.”
Robert Ashcroft, chief executive of PRS for Music, which collects royalties for music artists, welcomed the directive as “a massive step forward” for consumers and creatives.
“It’s about making sure that ordinary people can upload videos and music to platforms like YouTube without being held liable for copyright – that responsibility will henceforth be transferred to the platforms,” he said.
However the campaign group Open Knowledge International described it as “a massive blow” for the internet.
“We now risk the creation of a more closed society at the very time we should be using digital advances to build a more open world where knowledge creates power for the many, not the few,” said chief executive Catherine Stihler.
Google said that while the latest version of the directive was improved, there remained “legal uncertainty”.
“The details matter and we look forward to working with policy-makers, publishers, creators and rights holders, as EU member states move to implement these new rules,” it said.
Kathy Berry, senior lawyer at Linklaters, said more detail was required about how Article 13 would be enforced.
“While Article 13 may have noble aims, in its current form it functions as little more than a set of ideals, with very little guidance on exactly which service providers will be caught by it or what steps will be sufficient to comply,” she said.
European Parliament Rapporteur Axel Voss said the legislation was designed to protect people’s livelihoods.
“This directive is an important step towards 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.
“It helps make the internet ready for the future, a space which benefits everyone, not only a powerful few.”