LONDON — The former head of Britain’s foreign intelligence service, John Sawers, warned on Friday that the country’s security would be severely compromised if it left the European Union in the spring, and called on voters to reverse the “strategic mistake” in a second referendum.

Mr. Sawers made the comments in a speech in Salisbury, the city where a team of Russian military intelligence officers traveled this spring to attack a former spy, Sergei V. Skripal. Not mincing words, he said that Russia’s president, Vladimir V. Putin, now feels free to “treat Britain with contempt” because, in the age of Brexit and a fraying NATO alliance, it is isolated from its Western allies.

Russia poisoned another Russian, Alexander V. Litvinenko, in London in 2006. Mr. Sawers said it would not have staged another attack had it not perceived Britain as weakened.

“I don’t believe Russia would have used a nerve agent on the streets of an American or German city,” Mr. Sawers said. “The consequences would have been too great, the operation would not have been authorized. But Russia was willing to treat Britain with contempt.”

He added: “Our very weakness — as a result of Brexit, as a result of fraying trans-Atlantic ties — was an attraction for Russia. The weaker a country, the more attractive a target it is for bullies.”

Mr. Sawers, who headed the Secret Intelligence Service, known as MI6, from 2009 to 2014, also warned that by leaving the European Union, Britain would lose access to information-sharing mechanisms like passenger records and the Schengen Information System, slowing its ability to solve crimes and extradite suspects.

“The sort of thing Britain might lose access to is the ability to track terrorists around the E.U.,” he said in an interview. “It also loses the capacity to extradite suspects, including ordinary criminals and pedophiles. It takes days under the E.U. arrest warrant. It used to take months or years.”

He said that there was “real concern” in intelligence circles about losing access to these tools, but that it is not often aired publicly because “intelligence and security issues tend to be dealt with behind closed doors.”

Noting that Prime Minister Theresa May proposed a new treaty to preserve these arrangements, he asked, “Why are we leaving in the first place?”

“I think we are making a strategic mistake,” he said. “If we now withdraw through a tiny majority in Parliament on the back of a 52-48 referendum, the issue will not be settled. The Europe question will continue to dog British politics for years to come, and may well contribute to the breakup of the United Kingdom.”

Mr. Sawers, a foreign policy adviser to former Prime Minister Tony Blair, is not the only intelligence mandarin to wade into Brexit’s security implications in recent days.

One of his predecessors at MI6, Richard Dearlove, who supports Britain’s departure from the bloc, this week denounced Mrs. May’s proposal to preserve information-sharing agreements with European allies. He said that would “put the autonomy of our armed forces in jeopardy and risk fatally compromising” the so-called “Five Eyes” alliance uniting Australia, Britain, Canada, Australia, New Zealand and the United States.

“The E.U. has no business being in defense or security at all,” he wrote in a letter to The Times of London that was also signed by three officials of Veterans for Britain. “These are either NATO or nation-to-nation matters. The U.K. should withdraw all proposals to the E.U. in these areas.”

ELLEN BARRY