LONDON — Jeremy Corbyn had demanded an election dozens of times, insisting his Labour Party was eager, as he put it in July, to “let the people decide their future.”

But when British Prime Minister Boris Johnson dangled the prospect of a new vote last week, the leader of the country’s largest opposition party overcame temptation and batted it away, likening it to “an offer of an apple to Snow White from the Wicked Queen.”

Every other British opposition party joined him, forming a united front that led to two humiliating defeats for the prime minister — and a scrambled picture of where Britain goes next with Brexit.

The story of British politics in recent days has been dominated by Johnson’s stumbles, including an unbroken record of losses on key parliamentary votes, along with purges, defections and even family rejections

But analysts say it all would have turned out very differently had the so-called “rebel alliance” — a motley crew of opposition parties and moderate members of Johnson’s own Conservative Party — not hung together to thwart his plans for a possible no-deal exit from the European Union.

For parties and politicians unaccustomed to teaming up, the coordination has been a shock.

There has been “very little experience, if any, of close cooperation between opposition parties,” said Tom Brake, Brexit point person for the pro-E.U. Liberal Democrats and a member of Parliament since 1997. “The cooperation we’ve seen on Brexit is really the first example of that for many decades.”

Now, with Brexit and a possible election still in the balance, the question is how far the cooperation will go. In particular, analysts wonder whether Johnson opponents can demonstrate unity in backing something they are all for, instead of just blocking proposals they oppose.

“The opposition has managed to be united in frustrating the government,” said Bronwen Maddox, director of the London-based Institute for Government. “But the things that are not agreed are even more important.”

Most critical of all: what to do about Brexit and whether to form a pact in the next election, which is still expected later this year.

And on those questions, Johnson opponents have far less common ground. 

Although they all fear or loathe the idea of a no-deal exit, they have vastly different ideas about what shape Britain’s exit should take — or whether the country should leave at all.

Some — including a cross-party group created on Tuesday called “MPs for a Deal” — want Britain to quickly come to terms with the E.U. on a soft exit along the lines of the one negotiated by former prime minister Theresa May. 

Others, including Labour’s Corbyn, advocate a second referendum, potentially without the party taking a stand on whether voters should back “leave” or “remain.” 

The Liberal Democrats, meanwhile, have proposed canceling Britain’s plans for an exit by taking back the Article 50 withdrawal letter announcing the U.K.’s plan to leave. 

With Parliament suspended and lawmakers heading back to their districts, the anti-Johnson comity of recent days was already giving way to the contest for votes.

“We are the strongest ‘remain’ party,” said the Liberal Democrats’ Brake. “The Labour Party’s policy is so nuanced that nobody knows what it is.” 

The parties that cooperated in recent days will, in many cases, be vying for the same set of voters: Britons who backed remain, or who wanted to leave but don’t like the idea of crashing out without a deal.

In Britain’s first-past-the-post voting system, that means parties such as Labour and the Liberal Democrats could end up both losing to the Conservatives, even in areas that voted “remain,” if they divide the pro-E.U. vote.

Forming a pact in which parties agree on where to compete, and where to stand down, “can make a huge difference,” Maddox said. 

There’s a similar dynamic at play on the anti-E.U. side, with the nascent Brexit Party offering Johnson’s Tories a deal that could unite the “leave” vote. Johnson has so far been cool to the idea, but analysts say it could deliver him the majority he has sought. 

Brake said that if the Conservatives and the Brexit Party make a deal, then “opposition parties need to look seriously at how they would respond to that.”

Election cooperation would come with peril. Corbyn, who is unapologetic about left-wing views that include nationalization of the rail and energy sectors, is anathema to many of the pro-business voters of the Liberal Democrats. 

In Scotland, Labour and the Scottish National Party have been able to work together to oppose the Tories on Brexit, despite the fact that they disagree over whether Scotland should be independent — and maintain a bitter rivalry.

“We’ve reached the point where any action that can be taken to stop a no-deal Brexit has to be taken,” said Carol Monaghan, an SNP lawmaker who won a longtime Labour seat in Glasgow in 2015. “Even Labour is finally coming to that realization.”

As long as a no-deal Brexit is on the table, at least some level of cooperation appears likely to persist. In the wee hours of Tuesday morning, the opposition parties united to beat back Johnson’s second attempt to deliver an election, with Corbyn and others arguing that it represented a backdoor path to no-deal.

In the early hours of Sept. 10, opposition lawmakers shouted "Shame!" at Conservative members as British Parliament closed for a five-week suspension. (Parliament TV via Storyful)

And they stuck around for hours afterward to protest the government’s plan to suspend Parliament until mid-October. Opposition lawmakers attempted to halt that suspension, waving placards that read “Silenced,” shouting “Shame! Shame!” at Conservative members and trying to physically block Speaker John Bercow from leaving his chair. 

Bercow, who on Monday afternoon had dramatically announced plans to step down from the job, made clear he appreciated the rebellious mood. He called the decision to bar the doors of Parliament amid the political crisis of Brexit “an act of executive fiat.” 

Across the opposition benches, lawmakers cheered.