The EU has agreed to a new mechanism to freeze hackers' assets and ban them from entry anywhere in world.

The European Union’s new regime will directly penalise computer hackers following a diplomatic push by Britain and the Netherlands.

Many countries joined the push to allow the 28-country bloc to move more quickly against malign cyber attacks that can bring down crucial infrastructure.

“This is decisive action to deter future cyber attacks,” British Foreign Secretary Jeremy Hunt said in a statement.

The change came just days before European Parliament elections on May 23-26.

The EU says its sanctions scheme allows it to move quickly to punish future attacks, replacing the current system that relies on special country lists.

EU and NATO diplomats believe China, North Korea and Russia, have developed sophisticated computer hacking weapons and cyber surveillance software to spy on and undermine the West.