LIVERPOOL, England—A near-forgotten sensation of hope surged through anti-Brexit campaigners in Britain this week. It began with one or two Labour Party delegates standing to applaud, saluting an abrupt policy change that had been forced onto the party’s reluctant leader. Their numbers soon swelled into a standing ovation that swept across the hall of Labour’s annual conference.

For the first time in months, people there realized, there was a chance—however small—that Brexit could be stopped.

Unlike the vast majority of his party, Jeremy Corbyn, the Labour leader, and his old left comrade John McDonnell have opposed the European Union for decades. The party’s doctrinaire left flank has always decried the EU as an anti-democratic institution focused on Europe’s bankers rather than the continent’s workers.

Ironically, Corbyn’s determination to bolster the Labour Party’s own internal democracy has forced him to accept a policy that reverses one of his most deeply held beliefs. Corbyn and McDonnell, the pro-union firebrand seen as the party’s second most influential figure, have total ascendancy over the party moderates but under the Labour rulebook, which they have long championed, they must adopt the policies voted through by activists at the annual conference.

A poll published this week suggested that 86 percent of Labour Party members back a second referendum that could overturn Britain’s decision to quit the EU; that huge majority offers a rare moment of consensus within Labour Party ranks that includes pro- and anti-Corbyn factions.

At the party’s annual conference held on the unseasonably warm banks of the River Mersey in Liverpool this week, some members were tutting and murmuring their dissatisfaction at the policy shift in small sweaty rooms hosting the party’s most left-wing fringe events. But most of the conference disagreed.

It was reason to celebrate for Labour’s moderate Members of Parliament (MPs) for the first time since Corbyn’s shock ascent to the party’s leadership in 2015. Alison McGovern, one of the politicians running the campaign to change Labour’s Brexit policy, led the festivities on Tuesday night with a raucous DJ set at the center-left Fabian Society party.

For the first time, Corbyn and his closest comrades were outmaneuvered and over-ruled by the rest of the party.

In the case of McDonnell, Labour’s shadow chancellor, abandonment of his deeply held anti-European Union stance gradually was dragged out of him via a humiliating series of interviews over the course of a single day in which he changed his stated position at least three times. Each public utterance edged him further toward the acceptance that he could not defy the vote of the party’s delegates.

To be clear, Labour’s Brexit policy is still an almighty fudge. There is no coherent alternative vision for how the party wants to proceed, but the Labour leadership has been forced to say for the first time that all options remain on the table, including a second Brexit referendum that could overturn the 2016 decision to quit the EU.

Keir Starmer, the party’s Shadow Brexit minister, was cheered by delegates when he announced that it was also “increasingly likely” that Labour Members of Parliament would vote against Theresa May’s Brexit withdrawal deal—“No ifs, no buts”—when it is finally brought to the House of Commons.

The question of what would happen if the deal the prime minister has negotiated with Europe on the terms of Britain’s withdrawal from the union is rejected by parliament remains a conundrum. The only certainty is that it would trigger a constitutional crisis, which could lead to a run on the pound; the fall of the prime minister; or the collapse of the government.

It is at this point that Labour would be forced to do more than simply obstruct. The party has had over two years to come up with an alternative plan, but it preferred the refuge of “constructive ambiguity.”

At last year’s conference, the party didn’t even debate Brexit, much to the frustration of the party membership.

Corbyn, who has opposed Europe’s political and economic integration since 1975, wanted the issue to be left off the agenda again this year, but the powerful GMB trade union, one of Britain’s largest general workers’ unions, used its influence to force a debate on the conference floor. A Labour Party official admitted to The Daily Beast: “If it wasn’t for the unions, we wouldn’t even be debating Brexit.”

GMB officials spent weeks working with campaign groups on all sides of the debate ahead of conference to come up with a compromise motion that could be agreed by the widest possible swathe of the party. It was far stronger and more positive than the Labour leadership’s own version.

“We didn’t want a version that was so overly prescriptive,” a source involved in the negotiation told The Daily Beast. “It’s a much more powerful motion and a more radical motion, whilst at the same time being something which the Labour Party leadership were happy to work with. I think that was reflected by the cheers and support in the conference hall.”

After hours of give-and-take, the version that was agreed emphasized the desire for a public vote and highlighted the case for Labour to campaign for a new referendum to be held. Whether or not there is a second referendum, the motion also committed Labour to pursuing full participation in the single market, which would ensure continued political and economic alignment with the EU.

The final version read: “If we cannot get a general election, Labour must support all options remaining on the table, including campaigning for a public vote.”

Corbyn and McDonnell reportedly preferred wording that would have called for a public vote simply on the terms of Brexit—in other words how Britain would leave the European Union, not whether it would leave at all. They lost.

And yet the following morning, McDonnell, seemed to be claiming he had won. He told the BBC Today program that any referendum backed by Labour would exclude the chance to overturn Brexit.

Asked to explain what was happening, a panel of Labour Party policy heads from across the Brexit spectrum said his stance neither reflected the agreed wording of the motion nor made much sense.

“I don’t know if there’s some kind of smoke and mirrors going on,” said Stephen Kinnock, the MP for Aberavon in South Wales. “I’m simply baffled, I just don’t understand how you could have an EU referendum without the option of staying in the EU being on the table—just absurd.”

Gareth Snell—MP for Stoke-on-Trent Central, which voted heavily in favor of Brexit—has rejected any move by Labour colleagues to thwart Brexit, but even he couldn’t see the merit in McDonnell’s position. “I don’t support the idea of a people’s vote, but even I would be hard pressed to explain why the option to Remain wasn’t on the ballot paper because that, to me, seems perverse.”

McDonnell had softened his position by lunchtime as delegates were still shrugging their shoulders and asking each other if they’d heard McDonnell’s latest spin. By the end of the day, he finally accepted that the motion would mean all options were left on the table.

Starmer, who had been in the key negotiations himself, spent the day calmly repeating assurances that all options were still on the table. The former head of Britain’s Crown Prosecution Service was quietly contradicting McDonnell without emphatically challenging him.

That changed the following day when he spoke to delegates on the floor of conference in the most rousing moment of the week.

“Our options must include campaigning for a public vote,” he said, to applause. “And nobody is ruling out Remain as an option.”

The Remain line was not in the prepared text of the speech sent to journalists a few minutes before he took to the stage. It was greeted by a standing ovation in the hall.

Starmer’s position, now reluctantly accepted by the leader’s office, may have been greeted warmly by party members but a second referendum remains a remote possibility. As well as their long-held antipathy toward the EU, the leadership is fearful of a backlash from voters who felt their decision to leave had been betrayed.

Nonetheless, keeping the option on the table for now is hugely important, especially since the motion passed this week is to be reflected in the Labour Party manifesto if a new general election is required.

One senior former Labour official told The Daily Beast that if the Conservative government fell and Labour found itself in power, it would soon be swamped by internal political crises of its own. It would be extremely difficult to get any version of Brexit through a Labour House of Commons; with a second successive government on its knees, another referendum might be the only way out.