Prime Minister David Cameron on Monday said Britain must keep its EU "leadership" role to ensure that Europe is not plunged into a conflict that would inevitably affect the country.
"Can we be so sure that peace and stability on our continent are assured beyond any shadow of doubt?" Cameron said in a speech at the British Museum in London, warning of security risks if Britain votes to leave the European Union in an in-out referendum on June 23.
"The European Union has helped reconcile countries which were once at each others' throats for decades," he said, adding that he was making a "bold patriotic case" for remaining in the EU.
"Britain has a fundamental national interest in maintaining common purpose in Europe to avoid future conflict between European countries," Cameron said.
"And that requires British leadership, and for Britain to remain a member."
"And if things go wrong in Europe, let's not pretend we can be immune from the consequences," he said.
Cameron also talked about the security threats from Russia and Islamic State terrorists, but he avoided discussion of EU migration, a key issue for the Leave campaign.
"The dangerous international situation facing Britain today means that the closest possible cooperation with our European neighbours isn't an optional extra - it is essential," he said.
Maintaining security against the threat of cross-border crime and terrorism "means that we simply have to develop much closer means of security cooperation between countries within Europe," Cameron added.
Leave campaigners accused Cameron of hypocrisy, saying he had previously been willing to quit the EU without reforms but was now inferring exiting the EU could lead to war.
Ahead of the prime minister's speech, which came as both sides stepped up their campaigning after a lull during local elections last week, the Leave side said EU law allowed the possibility of Brussels one day controlling Britain's armed forces.
But Cameron said such ideas were "fanciful," adding that "we would veto any suggestion of an EU army."
Fellow Conservative politician Boris Johnson, the former London mayor who is the figurehead for the Leave campaign, also set out his case in a speech on Monday.
Johnson said he was outlining his "liberal cosmopolitan case" for a British exit from the EU, or Brexit.
"In the next six weeks we must politely but relentlessly put the following questions to the prime minister and to the Remain campaign," he said.
"How can you possibly control EU immigration into this country?" was his first question, followed by another question about the attraction of British wage levels to EU migrants.
Johnson's three other questions covered how to prevent the EU "from interfering further in immigration, asylum [and] human rights" and how to stop Britain being "dragged in" to "further moves towards a fiscal and political union."
The charismatic former Brussels-based journalist caused much hilarity by singing Beethoven's Ode to Joy in German, to try to prove that being against the EU does not mean being anti-European.
Cameron has urged people to vote for remaining part of the EU after he negotiated a deal earlier this year for reforms that would give Britain what he called a "special status."