Leaving the European Union could hamper the UK's ability to tackle threats such as Islamic State or Vladimir Putin's Russia, formersenior military commanders have warned.
The ex-service chiefs said Europe faced a series of "grave security challenges" and the UK was in a "stronger" position to deal with them from inside the EU.
The intervention by the former Royal Navy, Army and Royal Air Force chiefs comes amid fresh warnings about the scale of the migration crisis in Europe.
In a letter to The Telegraph, the former commanders told of their concern about the rise of IS, also known as Daesh, saying: "We have served around the world and in almost every conflict in which Britain has been engaged since the Second World War.
"We are proud to have served our country and to have played our part in keeping Britain safe. In the forthcoming referendum, therefore, we are particularly concerned with one central question: will Britain be safer inside the EU or outside it? When we look at the world today, there seems to us only one answer.
"Europe today is facing a series of grave security challenges, from instability in the Middle East and the rise of Daesh, to resurgent Russian nationalism and aggression.
"Britain will have to confront these challenges whether it is inside or outside the EU. But within the EU, we are stronger. Inside it, we can continue to collaborate closely with our European allies, just as we did when we helped to force the Iranians to the negotiating table through EU-wide sanctions, or made sure that Putin would pay a price for his aggression in Ukraine."
Signatories to the letter, which the newspaper said was in part co-ordinated by Downing Street, include former chiefs of defence staff Field Marshal Lord Bramall and Field Marshal Lord Guthrie.
Air Chief Marshal Lord Stirrup, Admiral of the Fleet Lord Boyce and former special forces chief General Sir Michael Rose are also among the 13 senior officers who backed the letter.
The intervention by the top brass came as figures revealed the scale of the migration crisis in Europe.
The International Organisation for Migration said more than 102,500 people had crossed into Greece since January 1 and another 7,500 streamed into Italy over the same period. Similar figures were not reached last year until June.