The SNP has signalled it could support installing Jeremy Corbyn in Downing Street on a temporary basis to thwart a no-deal Brexit.
As tensions between MPs and Downing Street deepened, Nicola Sturgeon suggested it could row in behind the Labour leader as a caretaker prime minister until a general election.
Mr Corbyn called on rebel Tories and opposition MPs to back him to lead a temporary administration in August – but the move was met with resistance, particularly from the Liberal Democrat leader Jo Swinson.
Under the proposals, opposition parties would seek to oust Boris Johnson in a vote of no confidence and then form a unity government that would seek an extension to prevent the UK crashing out of the EU on 31 October.
The plan failed to gain cross-party support at the time, but senior figures in the SNP are concerned that Mr Johnson could defy a law forcing him to delay Brexit if there is no deal in place before 19 October.
Nicola Sturgeon, the SNP leader, suggested that Mr Corbyn could be brought in to secure the extension as leaving Mr Johnson in charge would be a “terrible idea”.
Responding to a tweet suggesting installing the Labour leader or another temporary prime minister, she said: “Agree with this.
“Vote of no confidence, opposition unites around someone for sole purpose of securing an extension, and then immediate general election.
“Nothing is risk free but leaving Johnson in post to force through no deal – or even a bad deal – seems like a terrible idea to me.”
Veteran MPs Harriet Harman and Ken Clarke have both been named as potential figures to lead a unity government but a senior SNP source insisted it had to be the Labour leader.
“It is increasingly clear that we will have to instal a new prime minister via a vote of no confidence, so that we can request a delay to Brexit and hold an election,” the source told ITV’s Robert Peston.
“Trying to find a compromise candidate, a national unity candidate, is too complicated, especially in the time we have. Whether people like it or not, the temporary prime minister has to be Corbyn.”
An SNP spokesperson said the party was committed to stopping a no-deal Brexit and removing “this dangerous and undemocratic prime minister as soon as possible”.
The spokesperson said: “It is now possible – if the political will is there – that parties could come together to ensure that the letter to secure an extension is not left in the hands of Boris Johnson and his cronies, who are determined to find a way to get around the Benn Act, but is instead sent by a temporary caretaker prime minister, who would be in office only as long as is necessary to send the letter, with an election held immediately afterwards.
“We remain open to all options to achieve the aim of stopping a no-deal Brexit and getting rid of Boris Johnson.”
Even with SNP support, it would come down to a knife-edge vote for Mr Corbyn. There are 288 Tory MPs, as well as 10 Democratic Unionists, so the opposition would need some of the 34 independent MPs to come on board.
Labour argued that the plan was the “simplest and most democratic way to stop no deal”.
However the Liberal Democrats believe a temporary government led by Mr Corbyn cannot achieve the necessary support across the House, as he would need the backing of ex-Tory MPs and defectors from his own party.
Kirstene Hair, Tory MP for Angus, said: “This report confirms what many have long suspected – SNP MPs will happily prop up Jeremy Corbyn in No 10.
“There is no doubt that Corbyn’s weak stance on indyref2 is a deciding factor for the nationalists.
“He has already left the door open for a rerun of the 2014 referendum if he becomes prime minister.
“Only a Conservative government will stand up for those who voted ‘No’ in what was meant to be a once-in-a-generation event.”