Later on Monday, Mr Cameron's security warning was bolstered by five former secretaries general of the West's military alliance Nato - Lord Peter Carrington, Javier Solana, Lord George Robertson, Jaap De Hoop Scheffer and Anders Fogh Rasmussen.

In an open letter to the Daily Telegraph, they said it would be "very troubling" if the UK ended its membership of the EU.

"While the decision is one for the British people, Brexit would undoubtedly lead to a loss of British influence, undermine Nato and give succour to the West's enemies just when we need to stand shoulder to shoulder across the Euro-Atlantic community against common threats, including on our doorstep," they said.

301 Moved Permanently

Moved Permanently

EU referendum issues guide: Explore the argumentshttp://www.bbc.co.uk/news/uk-politics-eu-referendum-36027205http://www.bbc.co.uk/news/special/2016/newsspec_13606/content/iframe/english/index.inc.app.htmlExplore all the issuesChoose an issue:What both sides are sayingAll issuesMain viewsShare this pageEU referendum issues guideWhat the leave and remain sides are saying in the #EUref campaign

There are just over six weeks to go until the 23 June referendum which will decide whether Britain remains in or leaves the EU.

Despite his warning of the consequences of a vote to leave, Mr Cameron defended his decision to call the referendum, telling the BBC: "You shouldn't try to hold an independent sovereign nation in an organisation against its will."

His comments - and a rival speech from Mr Johnson - came as the referendum campaign intensifies, following last week's elections.

The PM, who was introduced by former Labour foreign secretary David Miliband, argued the EU - with Britain in it - had helped bring together countries that had been "at each others' throats for decades".

He warned the peace and stability Europe has enjoyed in recent years could not be guaranteed, saying leaving risked "the clock being turned back to an age of competing nationalism in Europe".

Media playback is unsupported on your device

Media captionBoris Johnson sings in German

Media playback is unsupported on your device

Media captionFarage: Threat to EU peace is lack of democracy

While Europe has largely been at peace since 1945, Mr Cameron said it was barely two decades since the Bosnian war while, more recently, Russia has been at war with Georgia and Ukraine.

"Can we be so sure that peace and stability on our continent are assured beyond any shadow of doubt? Is that a risk worth taking? I would never be so rash as to make that assumption," he said.

Mr Cameron argued "isolationism has never served this country well".

Analysis

Image copyrightGetty ImagesImage caption
David Cameron at the British Museum

By BBC Political Editor Laura Kuenssberg

During the course of political campaigns the claims being made on different sides become more and more well, shall we say, stretchy.

Mr Cameron ranked 2016 alongside other major events in European history, including the Spanish Armada in 1588, the battles of Blenheim and Waterloo in 1704 and 1815 respectively, the two world wars, as well as the fall of the Berlin Wall.

"The truth is this: what happens in our neighbourhood matters to Britain," the PM added.

"That was true in 1914, in 1940 and in 1989. Or, you could add 1588, 1704 and 1815... And if things go wrong in Europe, let's not pretend we can be immune from the consequences."

Vote Leave said Nato, not the EU, kept the UK safe and accused Downing Street of "losing the plot".

It said: "During the renegotiation the PM said he 'ruled nothing out'. Now he thinks leaving the EU would lead to war. What changed?"