EU member states have narrowly approved a massive overhaul of the bloc's online copyright law, setting up a crunch European Parliament vote to pass a law that has pitted traditional media against Silicon Valley.

The lobbying battle to reform Europe's copyright law has raged since September 2016 when the European Commission proposed to modernise copyright for the digital age, sparking a major debate between tech giants, artistic creators and member states.

Negotiators for the European Council, which represents the EU's 28 member states, and for the European Parliament had struck a provisional deal last week, but in a rare rebellion, several member states voted against the compromise on Wednesday, a European source said.

Italy, Poland, Luxembourg, the Netherlands and Finland voted against and released a joint statement slamming the deal.

The reform's goal was "to stimulate innovation, creativity, investment and production of new content," the countries said.

However, the final text "fails to deliver" and "is a step back" for the EU, they said.

Powerful Germany backed the deal, but voiced concern that the reform faced a harsh test in the European Parliament with opposition growing, a European source said.

The biggest stumbling block has been a provision that calls for YouTube and other platforms to remove illegal content using automatic filters, or face massive liability.

Another bone of contention is a provision to create "neighbouring rights" – that opponents call a link tax – for media publishers.

News organisations, including AFP, have pushed for the move, arguing that giants like Facebook and Google make billions in revenue from advertising tied to news stories, while publishers suffer.

This sparked a fight between traditional media seeking payment for online content on the one hand, and Silicon Valley as well as internet freedom activists on the other.

The final vote at the European Parliament is expected in March or April with the outcome considered highly uncertain.