The former head of MI6 has warned Theresa May’s Brexit deal will “threaten the national security of the country”, in a call for Tory MPs to reject it.

The agreement would “place control of aspects of our national security in foreign hands”, claims Sir Richard Dearlove, in an extraordinary letter to Conservative associations.

It has also been signed by Lord Guthrie, a former chief of the defence staff, in a bid to stiffen grassroots resistance, ahead of next Tuesday’s vote.

Sir Richard and Lord Guthrie, who are both prominent Leave supporters, write: “Please ensure that your MP votes against this bad agreement.”

The prime minister, a former home secretary, has insisted her agreement would protect national security by retaining existing cooperation arrangements during the 21-month transition.

However, she was forced to acknowledge the UK was likely to lose direct access to vital EU security databases after 2012, under the proposed long-term arrangements.

In their letter, the ex-security chiefs argue the deal is dangerous because it would weaken membership of Nato and existing “close” defence and intelligence ties with the US.

“This withdrawal agreement, if not defeated, will threaten the national security of the country in fundamental ways,” it says.

Downing Street hit back immediately, insisting the letter was “completely wrong” and that the Brexit deal offered the broadest security agreement the EU has with any of its partners.

But both sides of the Brexit divide seized on the intervention, arch-Brexiteer Owen Paterson calling it a “devastating warning”.

Police separate clashing Brexit protesters outside Parliament Show all 11 1 /11 Police separate clashing Brexit protesters outside Parliament Police separate clashing Brexit protesters outside Parliament Anti-Brexit protester Steve Bray (left) and a pro-Brexit protester argue as they demonstrate outside the Houses of Parliament Getty Images Police separate clashing Brexit protesters outside Parliament A pro-Brexit protester argues Getty Images Police separate clashing Brexit protesters outside Parliament Police surround the pro-Brexit protester after he confronted Steve Bray, a pro-European protester Getty Images Police separate clashing Brexit protesters outside Parliament A leave supporter is spoken to by a police officer as he argues with a remain supporter, Steve Bray, outside Parliament PA Police separate clashing Brexit protesters outside Parliament MPs in Parliament are to vote on Theresa May's Brexit deal next week after her December vote was called off in the face of a major defeat Getty Images Police separate clashing Brexit protesters outside Parliament A leave supporter is spoken to by a police officer PA Police separate clashing Brexit protesters outside Parliament Police look on as anti-Brexit protesters demonstrate outside the Houses of Parliament. Getty Images Police separate clashing Brexit protesters outside Parliament Police hold back a leave supporter PA Police separate clashing Brexit protesters outside Parliament A police officer speaks with anti-Brexit protester Steve Bray Getty Images Police separate clashing Brexit protesters outside Parliament Police surround a pro-Brexit protester after he confronted a pro-European protester Getty Images Police separate clashing Brexit protesters outside Parliament Conservative MP David Davies, wearing a gopro camera, speaks to anti-Brexit protester Steve Bray Getty Images

Stephen Doughty, a Labour member of the Home Affairs Committee and supporter of the People’s Vote campaign, said: “Sir Richard Dearlove is right that the deal is a bad one for our security.

However, he added: “His proposed solution of leaving the EU without any agreement at all would make things even worse.

“As members of the EU we have the European Arrest Warrant available to arrest and extradite terrorism and serious crime suspects, and we have full access to the key databases on crime suspects across Europe that are accessed thousands of times every day by British police forces.

The letter claims the agreement’s plans for a “new, deep and special relationship” with the EU will weaken the “fundamentals of our national security policy”.

“The first duty of the state, above trade, is the security of its citizens,” says the letter, jointly-authored with former chief of the defence staff Lord Guthrie.

“The withdrawal agreement abrogates this fundamental contract and would place control of aspects of our national security in foreign hands.