In a significant shift, Britain's main opposition Labour Party said Tuesday that the country's soon-to-be chosen new leader should hold a second referendum on whether to leave the European Union or remain in the bloc.

Labour leader Jeremy Corbyn said the party would campaign to stay in the EU if a referendum were called by whoever succeeds Prime Minister Theresa May. She announced her resignation last month after failing to get Parliament to back her divorce deal with the EU.

Lawmakers Boris Johnson and Jeremy Hunt are competing to replace May as Conservative Party leader and prime minister. The winner of the contest is due to take office later this month, and will have barely more than three months to win support for a Brexit deal before Britain's scheduled Oct. 31 departure date.

TRUMP CALLS THERESA MAY 'FOOLISH' ON BREXIT, BLASTS 'WACKY' AND 'POMPOUS' UK AMBASSADOR

Jeremy Corbyn, leader of Britain's opposition Labour Party, said that Britain’s next prime minister should hold a referendum on whether to leave the European Union or remain in the bloc. (AP Photo/Kirsty Wigglesworth, File)

Jeremy Corbyn, leader of Britain's opposition Labour Party, said that Britain’s next prime minister should hold a referendum on whether to leave the European Union or remain in the bloc. (AP Photo/Kirsty Wigglesworth, File)

In a letter to party members, Corbyn said that the new prime minister "should have the confidence to put their deal, or no-deal, back to the people in a public vote."

"In those circumstances, I want to make it clear that Labour would campaign for Remain against either no-deal or a Tory deal that does not protect the economy and jobs," he said.

Labour's opponents — and many supporters — have accused the party of dithering over Brexit for fear of alienating voters on either side of the national divide over Europe. Corbyn, a longtime critic of the EU, has resisted calls for a second referendum, saying Labour must respect voters' 2016 decision to leave.

The left-of-center party has previously rejected May's deal but also ruled out leaving the EU without an agreement, and called for an election that the party hopes will bring a Labour government to power.

But the party's poor showing in recent local and European elections suggests Labour is losing support to parties including the Liberal Democrats and the Greens that advocate remaining in the EU.

PRO-BREXIT LAWMAKERS TURN BACK ON EUROPEAN ANTHEM 'ODE T OJOY' AT EU PARLIAMENT OPENING

Corbyn's letter clarifies the party's position — up to a point. It's still unclear what Labour would do about Brexit if it formed a government.

Labour lawmaker Hilary Benn, who heads Parliament's Brexit Committee, said "this is a very significant moment."

"We saw what a lack of clarity did to Labour in the European elections. We got 14% of the vote," he said.

But John Mann, a Labour legislator who backs Brexit, said the shift would cost the party support in areas of the country that voted strongly to leave the EU.

"There's no indication whatsoever that voters in my area ... have changed their mind," he said.

"I've asked repeatedly of Jeremy Corbyn, what will be Labour's policy at a general election? I haven't been clear and I'm not clear now."

BRITSH AMBASSADOR WHO CALLED TRUMP 'INEPT' HAS THERESA MAYS 'FULL SUPPORT'

Tory contenders Hunt and Johnson are due to square off later Tuesday in their only head-to-head debate in the campaign.

Both vow to succeed where May failed and take Britain out of the EU — even if that means leaving without an agreement on divorce terms and future relations.

Most businesses and economists think a no-deal Brexit would plunge Britain into recession as customs checks take effect at U.K. ports and tariffs are imposed on trade between the U.K. and the EU. But many Conservatives think embracing a no-deal Brexit may be the only way to win back voters from the upstart Brexit Party led by Nigel Farage.

Bookies and pollsters make Johnson, a populist former mayor of London, the strong favorite over the stolid Hunt.

The television debate comes after numerous events around the country in which the candidates took questions individually from Conservative Party members.

CLICK HERE TO GET THE FOX NEWS APP

Hunt's supporters have expressed frustration at the reluctance of Johnson to take part in direct debate, and hope that this debate offers a chance to turn the contest around.

But it comes late in the campaign: Ballot papers have already gone out to the party's estimated 160,000 voting members, and many people will already have voted. That means that the impact may be limited even if Hunt's performance is strong.