David Cameron last night promised a new law to protect children from damaging online porn after Brussels ruled the existing measures were illegal.

The Prime Minister said he ‘spluttered over my cornflakes’ after reading the Mail’s revelation yesterday that new EU rules will outlaw porn filters.

Internet firms installed voluntary filters requiring people to ‘opt in’ to receive porn – rather than having access to it by default – after a Daily Mail campaign.

Scroll down for video

David Cameron promised to veto EU laws making internet filters used to protect children from porn illegal

But on Tuesday the European Parliament voted for a new law that means companies must not interfere with online traffic, regardless of its content, providing it is legal. It means the voluntary regime will be unlawful at the end of next year.

However, Mr Cameron said yesterday he had secured an ‘opt-out’ allowing the Government to bring in a law that would keep the filters in place in the UK.

Downing Street aides said the Prime Minister would bring forward ‘copper-bottomed’ legislation on an issue that was ‘clearly very important’ to him.

But the new law could still face a challenge in the European Court of Justice and be ruled illegal because it is more restrictive than the EU regime.

In the Commons, Tory MP Amanda Solloway urged Mr Cameron to ensure children remained protected from porn.

He replied: ‘It is vital that we enable parents to have that protection for their children from this material on the internet.

‘Probably like her, I spluttered over my cornflakes when I read the Daily Mail this morning, because we have worked so hard to put in place those filters.

‘I can reassure her on this matter, because we secured an opt-out yesterday so that we can keep our family-friendly filters to protect children.’

He added: ‘I can tell the House that we will legislate to put our agreement with internet companies on this issue into the law of the land so that our children will be protected.’

New EU laws will force internet firms to scrap the porn filters they installed but the PM says he will not allow it

The new rules make internet service providers treat all online traffic ‘without discrimination, restriction or interference’. As a result, only illegal material can legitimately be blocked.

Robert Oxley, from Vote Leave, which is campaigning for Britain to leave the EU in the planned in-out referendum, said: ‘The Government has now admitted that its voluntary filters have been outlawed by the EU.

‘It is wrong to claim that there has been an opt-out, otherwise it would not be legislating on them after the EU vote.’

He said the new law could be struck down by unelected EU judges, adding: ‘If we Vote Leave, we will take back control to set our own laws on important issues like this.

‘The Government said in March that a ban on porn filters was a “clear breach of a UK red line”, yet this is exactly what they have allowed the EU to do.’