LONDON (Reuters) - A British vote to leave the European Union next month could make the country more vulnerable to militant attacks and cause instability across the continent, two former senior British intelligence officials said.

John Sawers the head of M16 is seen attending an Intelligence and Security Committee hearing at Parliament, in this still image taken from video in London November 7, 2013. REUTERS/UK Parliament via REUTERS TV

John Sawers, who stepped down as head of the MI6 foreign intelligence service in 2014, and Jonathan Evans, who led the MI5 domestic spy agency until three years ago, warned that a British exit, or Brexit, could weaken intelligence-sharing between Britain and neighboring countries.

“Counterterrorism is a team game, and the EU is the best framework available — no country can succeed on its own,” they said in an article for the Sunday Times newspaper.

Britons will vote in a referendum on June 23 on whether to leave the 28-member EU, a decision with trade, investment, defense and political ramifications that stretch far beyond Britain’s borders. Britons are evenly split over whether the country should stay or go, opinion polls indicate.

National security has become a key battleground between rival campaigners since more than 150 people were killed in Islamic State attacks in Paris and Brussels.

Those wanting Britain to leave the 28-member bloc say an exit would hand the country greater control over its borders. Those backing membership, including Prime Minister David Cameron, say the EU helps to coordinate intelligence-sharing.

A eurosceptic lawmaker for the Conservative Party cast doubt on whether the comments were genuine, saying, in a personal capacity, that he had spoken to one of the authors in the last three weeks and he had expressed the opposite opinion - that leaving the EU would make no difference to our security.

Julian Lewis, chairman of parliament’s Defence Select Committee, said he was “disappointed” to see the article, which was challenged by other lawmakers campaigning to leave the EU.

Justice Secretary Michael Gove told the BBC that the argument was “flat wrong” and that many security experts did not think that a Brexit would harm Britain.

Sawers and Evans said modern intelligence work relied on the sharing of large data-sets and that Britain could be restricted in the information it received if it was not part of the EU.

The two men, who do not often speak out on national matters, said their concerns about the vote went beyond Britain’s security and that the removal of one of Europe’s main military powers could unsettle the EU itself.

“If the UK were to withdraw from the EU, the destabilizing effect on the EU itself — already beset with economic difficulties, the migration crisis and a resurgent Russia — could be profound,” they said.

“Those who are enemies of democracy would rejoice. In our judgment, there is a real risk that such a destabilization could, in time, lead to the fragmentation of the EU and the return of instability on the continent.”

Elsewhere, European Commission President Jean-Claude Juncker said in remarks published on Sunday that a Brexit would have unforeseeable consequences on future European cooperation.

“A negative result of the referendum would certainly have unpredictable consequences on European cooperation about which I don’t wish to speculate now because I believe that Britons will decide rationally,” Juncker told Germany’s Funke Media Group.

“All Europeans would very much like to keep Britain in the family,” he added.