Image copyright Getty Images

Jeremy Corbyn is "open to" using legislation to prevent a no-deal Brexit if his plan to overthrow the government in a vote of no confidence fails, the BBC has learned.

The Labour leader is understood to have had a discussion with the SNP on Friday over passing a law to extend Article 50, which would delay leaving the EU.

Several Labour figures believe the plan could gain a majority in the Commons.

PM Boris Johnson says the UK will leave the EU on 31 October "do or die".

He added that, even though he wants a deal with Brussels, Brexit will go ahead if one is not agreed.

Mr Johnson argues that it is vital to honour the 2016 referendum, in which 52% of voters supported leaving the EU.

But opponents say leaving without a deal will damage the economy and is not wanted by many of the voters who backed Brexit.

Labour's existing plan is to bring down Mr Johnson's government in a no-confidence vote in the Commons after MPs return in September and install Mr Corbyn as temporary prime minister.

However this has been met with opposition by several Remain-supporting Conservative MPs who want to stop no deal, but do not want to put the Labour leader in Downing Street.

Liberal Democrat leader Jo Swinson has also said she would not support making Mr Corbyn prime minister.

She has suggested the possibility of installing either former Conservative Chancellor Ken Clarke or ex-Labour deputy leader Harriet Harman in Downing Street instead.

'Wreck the economy'

BBC political correspondent Nick Eardley said it was being suggested within Labour that a no-confidence motion in Mr Johnson's government and moves to extend Article 50 could run in tandem, with the latter operating as back-up to the main plan.

Opposition figures are drawing up proposals to seize control of the parliamentary agenda when MPs return from recess.

They would then try to pass a law mandating the prime minister to seek a further extension to the Brexit process to avoid no deal.

Those involved in the plan have suggested the law would be co-signed by opposition leaders and prominent Tory rebels to maximise its appeal. A source said: "We need to coalesce around legislation".

Downing Street has said Mr Corbyn will "overrule the referendum and wreck the economy" if he became prime minister.

A No 10 spokesman said: "Jeremy Corbyn believes that the people are the servants and politicians can cancel public votes they don't like."

Mr Johnson has also said the EU has become less willing to compromise on a new deal with the UK because of the opposition to leaving in Parliament.

He said this increased the likelihood of the UK being "forced to leave with a no deal" in October.

How does a vote of no confidence work?

If the government loses a no-confidence motion, it would trigger a critical 14-day period, after which a general election could be triggered.

If Mr Johnson failed to win such a vote, then a general election would be called.

There are no firm rules about who else, if anyone, should get the chance to form an alternative government during this time.

The leader of the opposition is clearly a likely candidate, but that is not an inevitable outcome.

The Cabinet Manual - a document which sets out the main rules covering the working of government - suggests that the principles applied should be similar to those after an election in which no one party wins a majority.

That means that the old prime minister should only resign if and when it's clear that somebody is more likely to have the support of MPs.

So it is possible that the existing prime minister would stay in place, or that more than one leader would get a chance.

Mr Johnson has a working majority of just one in the House of Commons, with the backing of Northern Ireland's Democratic Unionist Party.

What is a vote of no confidence?