LONDON (Reuters) - Britain could be safer if it voted to leave the European Union because it would have greater control over immigration, said Richard Dearlove, the former head of the MI6 foreign intelligence service.

Sir Richard Dearlove, former head of the MI6 foreign intelligence service, takes part in the panel discussion "Global Risk" at the 2011 The Milken Institute Global Conference in Beverly Hills, California in this file photo dated May 3, 2011. REUTERS/Lucy Nicholson

The comments, just days after the attacks in Brussels, contradict Prime Minister David Cameron who has argued that in an increasingly unstable world, Britain would be weaker and more insecure if it dropped out of the EU.

Dearlove, head of the Secret Intelligence Service from 1999 to 2004, said that leaving the EU would do little damage to Britain’s national security and could reap security gains.

“Whether one is an enthusiastic European or not, the truth about Brexit from a national security perspective is that the cost to Britain would be low,” Dearlove wrote in Prospect magazine.

“Brexit would bring two potentially important security gains: the ability to dump the European Convention on Human Rights...and, more importantly, greater control over immigration from the European Union.”

Attacks in Brussels on Tuesday spilt over into Britain’s debate about whether to remain in the EU, with advocates for leaving claiming the bloc’s open border policy allowed for the killings to take place.

Dearlove said the United States would disapprove of a British exit from the EU but that the relationship with Washington would mend.

Casting Britain as Europe’s leader in intelligence and security, Dearlove said the EU’s national security would be at a disadvantage without Britain.

“Europe would be the potential losers in national security,” he said. “But if Brexit happened, the UK would almost certainly show the magnanimity not to make its European partners pay the cost.”

EU security bodies were “colanders” which “must accommodate the slowest and leakiest of the ships of state”, he said.