London (AFP) – A former head of Britain’s domestic spying agency MI5 warned Wednesday against the prospect of leaving the European Union, saying it would weaken the country at a time of increased threats.

“We are undoubtedly safer in the EU,” Eliza Manningham-Buller, who headed the secret intelligence agency between 2002 and 2007, said in a speech at the Chatham House think tank in London.

“We receive substantial, life-saving intelligence from our European friends,” she said.

Several current and former security officials have spoken out in favour of a “Remain” vote in Britain’s June 23 membership referendum but some have said the country could be safer outside the EU.

Manningham-Buller referred to a series of potential threats to Britain from Islamic State group extremists and nuclear tests in North Korea.

It was “not the time to back away from the EU,” she said, warning that Britain’s influence “would decrease”.

“If Europe is weakened by our departure, it will weaken our security,” she said.

The former MI5 chief also rejected the idea that curbs on immigration would increase security.

“Trump-inspired barricades around our islands” will not stop the threat, she said in reference to comments by the presumptive US Republican presidential candidate Donald Trump about barring Muslims from the United States.

“The idea that the terrorist threat is coming from Europe is wrong. They are born here, they are ours,” she said.

Richard Dearlove, who headed the MI6 foreign intelligence agency between 1999 and 2004, said in March that Brexit could increase Britain’s security because it would allow the government to clamp down on immigration.