(Bloomberg) -- Theresa May’s justice secretary had a warning for the U.K. prime minister when he offered to resign from the Cabinet: He wouldn’t be the only one.

It was Thursday morning in another week of Brexit drama and David Gauke was dealing with the fallout of defying May. The previous night in Parliament had been surreal and chaotic, a reflection of Europe’s second-biggest economy tearing itself apart politically, unable to agree on a way to consummate the break with the EU mandated by voters in 2016.

Gauke, a 47-year-old member of parliament from southwestern England, was one of 13 government ministers who voted on Thursday to rule out an economically damaging no-deal exit from the European Union. Because that involved backing a motion that May opposed, he was being urged by Julian Smith, chief whip of May’s Conservative Party, to take the plunge and resign.

That’s when Gauke suggested May would risk a mass walkout. He’s still in his job. And she’s still in office, but no longer fully in control.

The confrontation over the phone marked the low point in May’s wild week of diplomacy, defeat and squeaking by to keep her Brexit deal alive. Here’s the story of the crucial moments, based on accounts by Cabinet members, senior officials and lawmakers who asked for anonymity to speak candidly.

In the Countryside

It was 2:15 a.m. on March 12 when Theresa May finally made it to bed. She had spent much of Tuesday on a frantic 1,000-mile (1,600-kilometer) round trip to Strasbourg for talks with European Commission head Jean-Claude Juncker. The trip back, aboard a 33-year-old British government BAe-146 commuter jet, was late and uncomfortable, with only an uninspiring dinner to keep her going.

In the morning, she wanted to present Parliament with an “improved” Brexit deal agreed with Juncker, hoping that the legally binding changes would persuade skeptical colleagues to vote for it. All that was needed was Attorney General Geoffrey Cox’s seal approval.

While May drifted off to sleep in the Downing Street apartment she shares with her husband, Cox was hard at work, fueled by black coffee. The 58 year-old lawyer was having doubts.

After working all night, Cox presented the result to May and her Cabinet in his sonorous courtroom baritone. His verdict -- that the revised exit deal failed to eliminate the risk that the U.K. would be trapped in the EU’s trade rules -- stunned May and her ministers. Her proposal to Parliament was doomed.

Coordinating with Cox isn’t easy at the best of times. He lives in rural western England, more than 200 miles from London, with no mobile phone signal inside his house. Colleagues say his land line sometimes fails, too.

Flying Standby

All of last weekend and into Monday, May’s plane was on standby for a dash to Brussels or Strasbourg to seal the deal with Juncker. With the stakes so high, she put off the trip at least three times.

When they finally met, Irish Prime Minister Leo Varadkar objected so strongly to the compromise plan that the press conference was held up. At issue was May’s push to rewrite the terms of the so-called backstop, which seeks to rule out customs checks at the U.K.-Irish border even if there’s no new trade deal between Britain and the EU.

According to one account, the biggest difficulty was that the U.K. wanted to invoke its right under the Vienna Convention on international treaties to exit any agreement as a way to terminate the backstop.

No reference to Vienna emerged in the final text. That’s what may have led Cox to agonize all night and then produce only a guarded endorsement.

Twitter Frustration

By 10 a.m. on Tuesday, Cox was short on sleep and patience. When television journalist Jon Snow asserted on Twitter that the attorney general had rejected May’s deal only to be told to think again until he could find a way to approve of it, Cox tweeted back, “Bollocks.”

Cox’s 1,700-word legal opinion sent shock waves through Westminster. It concluded that if the U.K. and EU can’t agree on a new trade partnership, the risk that Britain will be trapped in the Irish backstop “remains unchanged,” May’s trip to Juncker notwithstanding.

Thirty minutes later, a weary May, struggling with a sore throat, addressed a crowded meeting of the Conservative Party inside Parliament. She urged her colleagues to be reassured by Cox’s legal advice, to no avail.

In the Commons chamber on Tuesday afternoon, May sucked on lozenges and sipped water throughout the debate. Allies of the prime minister blamed the previous night’s meeting with Juncker, who’s a smoker.

‘Unenviable Choices’

When the vote rejecting May’s Brexit deal was read out at 7:22 p.m., she couldn’t hide her dismay after spending two years negotiating it.

“I profoundly regret the decision that this House has taken tonight,” she premier said. Now Parliament must decide what’s next -- a second referendum or no Brexit at all?

“These are unenviable choices,” May said. “But thanks to the decision the House has made this evening they must now be faced.”

The more immediate question for Parliament was whether to take the plunge of a no-deal Brexit, a central dilemma splitting the Tories.

By Wednesday, in a bid to keep the peace, May decided to let party members vote their conscience. She worded her motion very carefully, ensuring that it did not rule out a no-deal Brexit forever, just for March 29, the U.K.’s scheduled exit day.

Failed Endgame

May called an informal Cabinet meeting in her private office inside Parliament at 6:10 p.m. to explain her proposals for a vote the following day to extend the Brexit deadline.

What followed was chaos. When voting on the no-deal motion began at 7 p.m., more than 40 pro-EU Tories defied May’s orders. The mass rebellion meant May’s carefully crafted motion was torn up and replaced with a stronger text rejecting any possibility of a no-deal Brexit.

This threw the government’s “whipping” operation -- which enforces May’s voting instructions -- into disarray. With minutes to spare before the final vote, at 7:31 p.m., the government whips sent text messages to Tory MPs ordering them to vote against the reworded motion ruling out a no-deal Brexit. For pro-European ministers such as Gauke, that was too much.

Gauke, Business Secretary Greg Clark, Pensions Secretary Amber Rudd and Scottish Secretary David Mundell all ignored the order from on high and abstained, effectively helping pass the toughened motion.

Intrigue, Bad Blood

May, meanwhile, had all but lost her voice. With five minutes’ notice, Cabinet minister Andrea Leadsom was put on standby in case she had to step in to deliver the prime minister’s response in Parliament. May managed to speak, announcing plans to delay Brexit by at least three months -- or much longer, if there’s still no deal by March 20.

But the parliamentary decorum was overshadowed by bad blood and finger-pointing.

Some senior Tories suspected a power struggle was playing out in May’s inner circle. Allies of the chief whip Julian Smith accused May’s advisers of undermining him and encouraging ministers to abstain. Pro-Brexit ministers such as Leadsom and the Brexit Secretary Steve Barclay were furious with their Cabinet colleagues for rebelling. Others were dismayed at the breakdown of government discipline.

Too Weak to Govern?

For some, the government was done and May’s authority was too weakened to keep governing. That notion was put to the test on Thursday with members of Parliament proposing a radical move to take control of the Brexit process, depriving May of policy-making powers.

After Gauke’s dramatic call with the chief whip, May gathered all her Cabinet ministers together in Downing Street at 1:30 p.m.

It was the fourth Cabinet meeting in three days, a frequency reminiscent of wartime. May was furious at the revolt and, despite a weakened voice, her rage was clear to all.

When the vote came, May’s last-ditch plan won by the narrowest margin possible: 314 in favor to 312 against. If just one MP had changed sides, the result would have been a tie.

The prime minister is likely to put her deal to another vote on Tuesday. U.K. politicians will have to choose between voting for her Brexit version or for a delay that could last more than a year and ultimately cancel Brexit altogether.

All of the tension is a test for British understatement.

“It’s all pretty squeaky at the moment,” a May aide said after the week’s final vote. “But it could have been a lot worse.”

--With assistance from Alex Morales.

To contact the reporters on this story: Tim Ross in London at tross54@bloomberg.net;Robert Hutton in London at rhutton1@bloomberg.net;Kitty Donaldson in London at kdonaldson1@bloomberg.net

To contact the editors responsible for this story: Flavia Krause-Jackson at fjackson@bloomberg.net, Tim Ross, Tony Czuczka

©2019 Bloomberg L.P.