A former US justice department official has warned European governments to respond forcefully to hackers attempting to influence the outcome of forthcoming elections.

John Carlin, former assistant attorney general to the Obama administration, said the United States did not do enough to deter hackers and prevent Democratic Party emails from being leaked in the run-up to the presidential election.

In response to the leaking of Democratic Party emails, President Obama ordered the expulsion of 35 suspected Russian spies, nearly two months after the election.

"What we did was too late," Carlin admitted at the RSA cybersecurity conference. The cybersecurity expert, who used to head up the national security division at the Justice Department, called on European governments "to make it clear what the red line is, that there's going to be strong deterrence".

John Carlin
John Carlin, former US assistant attorney general for national security, issued the warning at a cybersecurity conference Jonathan Ernst/Reuters

"Our policy has got to be we are going to take action until the action stops," Carlin said. "So there is no ceiling on the level we will ratchet up the deterrence when you are undermining a core value."

His warning comes as Europe gears up for a series of crucial elections in The Netherlands, France and Germany. Carlin urged the three countries to put preemptive measures in place to avoid another hacking scandal.

The Dutch government announced on 2 February that ballots will be counted by hand. The decision was taken after cybersecurity experts warned that Russia may intervene in the elections billed for 15 March.

The Kremlin has strongly denied Russia is planning a cyberattack in The Netherlands and put the accusation down to "bizarre hysteria".