Boris Johnson is ready to face down a challenge from pro-EU MPs who may seek to topple his government this autumn by quietly preparing for a “people versus the politicians” election after the UK has left the EU on October 31, with or without a deal.

The British prime minister, who has a working majority of just one in the House of Commons, has consistently said he would not call an election before Brexit. But Downing Street officials are making preparations in the event of losing a confidence vote when parliament returns in September.

If the government falls, senior aides — including Mr Johnson’s most influential adviser, Dominic Cummings — are confident that Brexit cannot be delayed or halted by parliament. Officials believe that MPs manoeuvring to stop a no-deal Brexit — notably the former attorney-general Dominic Grieve — have underestimated the prime minister’s determination to ensure the UK leaves “by any means necessary” at the end of October.

“Someone put Grieve’s idea to Cummings on Friday that if we lose a vote of no confidence the PM will have to resign — he spat his drink out laughing,” said a senior No.10 official. “The idea we will hand over to a new government rather than leave with an election after October 31 is laughable.”

Allies of Mr Johnson likened the battle to see Brexit delivered to Vote Leave’s pugilistic style during the 2016 referendum — several individuals from that campaign now serve Mr Johnson. One government official said that pro-EU MPs, such as Mr Grieve, had already torn up parliamentary rules and they should not be surprised if the government did the same.

Someone put Grieve’s idea to Cummings on Friday that if we lose a vote of no confidence the PM will have to resign — he spat his drink out laughing

“I think the Vote Leave people in here will do literally anything to win. Cummings is already planning the Facebook campaign for a ‘people versus the politicians’ election,” the person said.

“He’s told this building: if [Jeremy] Corbyn sides with [Dominic] Grieve then he can force an election but the election will destroy the Corbyn project and the Labour party without even stopping Brexit. That’s the choice the Corbyn team have to face shortly.”

Under the terms of the Fixed-terms Parliament Act, MPs would have 14 days to try to form an alternative government after which Mr Johnson would have significant influence on the timing of a poll. He would likely seek to delay it until November, after which the UK would have left the EU under the terms of Article 50.

“Dom [Cummings] has made it very clear that even if Remainers tried to push forward a vote of no confidence in September, there is no mechanism to stop us leaving on October 31,” said a Whitehall official

In response Mr Grieve told the BBC “there are a number of things which the House of Commons can do, including bringing down the government and setting up a new government in its place” — a reference to forming a government of national unity with MPs from several parties.

Constitutional experts, however, have pointed out this would depend on Mr Johnson resigning after losing a confidence vote — something Downing Street insiders insist he will not do. Catherine Haddon, a senior fellow at the Institute for Government think-tank, said the prime minister would be “perfectly able, constitutionally” to call an election on a date of his choosing after October 31.

With a policy of leaving the EU under any circumstances in 88 days, and its working majority almost gone following its loss in the Brecon and Radnorshire by-election last week, the Conservative party now has a gossamer-thin grip on power.

“We have a single-digit majority and we have to be realistic about the chances that a general election is going to happen. If it does, our absolute intention would be to win it,” said one Conservative party insider. “It’s a pragmatic stance, given what some people have said about supporting the government in any confidence vote.”

Since Mr Johnson entered Downing Street last month, his government has been preparing itself for an election — despite the prime minister’s repeated comments that he will not countenance going to the polls.

The pace of work in the new government also points towards an election in the near future. “People are working crazy hours. The government feels like a campaign unit preparing for a general election,” said one official, who added: “This form of government and discipline, run from the centre, is not sustainable.”