Theresa May must use the dying days of her premiership to pass a law to prevent her successor taking Britain out of the EU in a no-deal Brexit against the will of parliament, a former cabinet minister has said.

Sir Ed Davey said Ms May was likely to be followed into No 10 by a hardline Brexiteer, such as Boris Johnson or Dominic Raab, who is ready to quit Europe without an agreement on 31 October.

MPs have already voted by a majority of 43 against a no-deal outcome, but that motion was not binding on the government.

Sir Ed said it was “a genuine worry” that a prime minister seeking to achieve a no-deal exit could simply suspend parliamentary sittings through a process known as “prorogation” until the Halloween deadline has passed in order to avoid MPs staging another vote to prevent it.

Under UK and EU law, Britain will leave without a deal by default on the deadline of Halloween unless a fresh extension is approved, a withdrawal agreement is ratified on both sides or the Article 50 letter informing Brussels of its intention to quit is revoked.

The former energy secretary – who is thought likely to be a contender to succeed Sir Vince Cable in the upcoming contest for Liberal Democrat leader – told The Independent: “There is a lot I disagree with Theresa May on, but I believe that she is a responsible person who wants to do what is right for the national interest.

“I think she needs to recognise the danger to our country of a future Tory prime minister who is a no-deal Leaver.

“And she needs to use the remaining powers she has in the remaining days she has left to help the majority in parliament insulate our country from that danger.”

Prorogation marks the end of a parliamentary session and is normally followed by a short recess until the Queen’s Speech that opens the next session. There is no fixed timetable, leaving the timing in the government’s hands. The current session, which began after the 2017 election is already the longest for many centuries, after Ms May stretched it to the limits in the hope of getting her Brexit deal through.

Boris Johnson says he will defenitely run for office at Swiss Economic Forum

With the new prime minister expected to be installed in No 10 just days before MPs leave Westminster for their summer break in July, and with a further three-week break for party conferences in late September and early October, parliament is anyway scheduled to sit for only a few weeks under the new regime before the Halloween deadline.

Sir Ed said he was concerned that a no-deal prime minister, elected by a deeply anti-EU Tory membership of around 125,000, could use prorogation to ensure that MPs are not present in Westminster to stop them driving the country over the cliff-edge.

“This is a genuine worry,” he told The Independent. “I think people from across parties ought to put pressure on the PM to put forward a piece of legislation as prime minister to put into law that there can’t be an exit from the EU of any nature without a vote in parliament.

“We have to have a procedure to prevent a no-deal Brexit being imposed on our country by a small number of MPs from a party with a leader who has effectively been elected prime minister by a very, very small and unrepresentative portion of our country.”

He called for cross-party talks to draw up and pass legislation in the few weeks left to Ms May.

Theresa May gets emotional during her resignation Show all 13 1 /13 Theresa May gets emotional during her resignation Theresa May gets emotional during her resignation British Prime Minister Theresa May reacts as she delivers a statement in London, Britain, May 24, 2019. REUTERS/Toby Melville TOBY MELVILLE Reuters Theresa May gets emotional during her resignation British Prime Minister Theresa May reacts as she delivers a statement in London, Britain, May 24, 2019. REUTERS/Toby Melville TOBY MELVILLE REUTERS Theresa May gets emotional during her resignation Prime Minister Theresa May making a statement outside at 10 Downing Street in London. PRESS ASSOCIATION Photo. Picture date: Friday May 24, 2019. See PA story POLITICS Brexit. Photo credit should read: Dominic Lipinski/PA Wire Dominic Lipinski PA Theresa May gets emotional during her resignation British Prime Minister Theresa May reacts as she delivers a statement in London, Britain, May 24, 2019. REUTERS/Toby Melville TOBY MELVILLE REUTERS Theresa May gets emotional during her resignation Prime Minister Theresa May makes a statement outside at 10 Downing Street in London, where she announced she is standing down as Tory party leader on Friday June 7. PA Theresa May gets emotional during her resignation British Prime Minister Theresa May delivers a statement in London, Britain, May 24, 2019. REUTERS/Toby Melville TOBY MELVILLE REUTERS Theresa May gets emotional during her resignation British Prime Minister Theresa May delivers a statement in London, Britain, May 24, 2019. REUTERS/Toby Melville TOBY MELVILLE REUTERS Theresa May gets emotional during her resignation British Prime Minister Theresa May makes a statement, at Downing Street in London, Britain, May 24, 2019. REUTERS/Hannah McKay HANNAH MCKAY REUTERS Theresa May gets emotional during her resignation Britain's Prime Minister Theresa May announces her resignation outside 10 Downing street in central London on May 24, 2019. - Beleaguered British Prime Minister Theresa May announced on Friday that she will resign on June 7, 2019 following a Conservative Party mutiny over her remaining in power. (Photo by Tolga AKMEN / AFP)TOLGA AKMEN/AFP/Getty Images TOLGA AKMEN AFP/Getty Theresa May gets emotional during her resignation British Prime Minister Theresa May makes a statement, at Downing Street in London, Britain, May 24, 2019. REUTERS/Hannah McKay HANNAH MCKAY REUTERS Theresa May gets emotional during her resignation British Prime Minister Theresa May delivers a statement in London, Britain, May 24, 2019. REUTERS/Toby Melville TOBY MELVILLE REUTERS Theresa May gets emotional during her resignation British Prime Minister Theresa May speaks in the street outside 10 Downing Street in London, England, Friday, May 24, 2019. Theresa May says she'll quit as UK Conservative leader on June 7, sparking contest for Britain's next prime minister. (AP Photo/Alastair Grant) Alastair Grant AP Theresa May gets emotional during her resignation Britain's Prime Minister Theresa May leaves after announcing her resignation outside 10 Downing street in central London on May 24, 2019. - Beleaguered British Prime Minister Theresa May announced on Friday that she will resign on June 7, 2019 following a Conservative Party mutiny over her remaining in power. (Photo by ISABEL INFANTES / AFP)ISABEL INFANTES/AFP/Getty Images ISABEL INFANTES AFP/Getty Images

And he said that the prime minister would be able to push such a bill through with the support of Liberal Democrat votes as well as many Labour and Tory MPs who fear no-deal.

“I think there needs to be some good cross-party talks,” he said.

“I would prefer legislation to go through which would require a People’s Vote on any final outcome, with the option of Remain on the ballot paper.