Two ministers have resigned from UK Prime Minister Theresa May’s cabinet, throwing her government into chaos and threatening the future of a proposed Brexit deal.

Brexit Secretary Dominic Raab and Work and Pensions Secretary Esther McVey both handed in their resignation on Thursday, less than 24 hours after May said she had secured cabinet approval for a draft Brexit agreement. These high-profile departures come as the United Kingdom and European Union attempt to hash out the terms of the UK’s exit — or “Brexit” — after Britons voted in a June 2016 referendum to leave.

The two sides have until March 29, 2019, to reach an agreement and get it ratified by both parliaments. On that date, the UK’s membership in the EU will expire, deal or no deal, with potentially catastrophic results: Air travel in the UK could grind to an immediate halt, British supermarkets could run out of food ... the list goes on.

May and the EU are desperately trying to avoid a no-deal scenario. After months of stalled negotiations, the two sides finally thought they had reached a breakthrough this week that solved some of the thorniest issues of the divorce, and provided for a transition period so they could work out a future trade deal.

On Wednesday, May called her new draft plan the “best agreement that could be negotiated,” and the apparent backing of her cabinet cleared the way for it to move forward.

But the latest dramatic resignations reveal the obstacles that May faces in finalizing the withdrawal. May’s Conservative Party is split between hardliner “Brexiteers” who want a clean break with the European Union, and others who are angling for a less disruptive, “softer” Brexit, which would involve closer ties with the EU.

The “hard” Brexit camp was agitating against May’s latest proposed Brexit deal before the text had even been released. They see it as a betrayal, and they fear it will leave Britain subject indefinitely to the rules and regulations of the EU.

May is still moving forward with the draft agreement, saying it’s basically this or nothing — but it will be difficult since factions within her own party, and the opposition Labour Party, have opposed it. She’s also up against a significant leadership challenge, as hardliners are calling for a “no confidence” vote.

May insisted at a press conference on Thursday that despite the challenges, she’s going to see this deal through. But it’s clear these latest resignations have thrown everything into turmoil.

“Right now we’re in a moment of high uncertainty, but I wouldn’t fully discount the current Brexit deal,” Abraham Newman, a political scientist at Georgetown’s Walsh School of Foreign Service, told me. “This is like a high Game of Thrones, or House of Cards moment where the hard Brexiteers are trying to leverage their power.”

The central issue the UK is warring over

Britons voted, 52 to 48 percent, to leave the European Union in June 2016. Those who campaigned for a Brexit argued that the UK would regain its sovereignty, including more control over its territory when it came to migration.

The “Remain” camp — those who wanted to stay within the EU — saw this as somewhat wishful thinking, and argued that extracting the UK from its decades-long membership in the bloc would be a cumbersome, unpredictable process.

That has proved to be the case since May, in March 2017, formally trigged Article 50, a part of the Lisbon Treaty that governs the EU, to initiate the exit process from Europe. That set off a two-year timeline to reach a Brexit deal, with the deadline set for March 29, 2019.

The core question in these negotiations is which (if any) EU treaties and laws will continue to apply to the UK after it’s left. But while that may sound fairly simple, it’s anything but.

And one of the biggest hurdles to negotiating a deal with the EU is that the UK government itself first has to decide what kind of relationship it wants the country to have post-divorce.

The two competing visions for what that relationship should look like are usually referred to as “hard Brexit” and “soft Brexit.”

“Hard” Brexit

In this scenario, the UK envisions a clean break with the EU, and would then try to negotiate some sort of free trade deal with the EU. The UK gains control over things like immigration and borders, but it also loses the perks of being part of the European Union single market and customs union, which eliminate tariffs and many other trade barriers for EU member states.

That arrangement would make the more hardcore anti-immigration Brexiteers happy but would also likely be incredibly disruptive to businesses and the country’s economy.

“Soft” Brexit

A “soft” Brexit involves a much less severe break with the EU. Broadly speaking, the UK would stay close to the EU and retain access to the single market and customs union. This would soften the blow to the British economy when Brexit becomes official, and it’s something Remainers — though they never wanted to leave in the first place — tend to favor if Brexit has to happen.

The caveat, though, is that the UK would also have to abide by many of the EU laws and regulations that govern the single market and customs union. And since it would no longer be an EU member, the UK would have little or no say in what those rules are or how they’re applied.

Hard Brexiteers hate this approach because they consider it to be a Brexit in name only that would fail to restore the UK’s full sovereignty over its own affairs and leave the country at the whims of decision-makers in Brussels, where the EU is headquartered.

May’s Conservative Party is sharply divided between those who favor a hard Brexit and those who prefer some sort of agreement that eases the UK out of the EU. And it’s because of this split that May is facing resistance from her own party over this latest Brexit draft deal, which they don’t see as sufficiently Brexit-y enough.

What’s in May’s draft Brexit proposal

The nearly 600-page draft Brexit deal, published Wednesday, tackles exactly how and when the EU and the UK will break up. Here are some of the key takeaways:

A transition period to figure out a future a UK-EU trade deal

This proposed withdrawal agreement calls for a 21-month transition period, until December 31, 2020, where all of the UK will remain in single customs territory as the EU and the UK work out this new trade relationship, though the transition period can be extended past 2020 date.

A “backstop” safeguarding an open border between Ireland and Northern Ireland

Most critically, this plan provides a safeguard solution to the Irish border question — which had previously brought the UK and EU negotiations to a standstill. The UK’s membership in the EU helped preserve an open border between Northern Ireland (which is part of the UK) and the Republic of Ireland (which is part of the EU).

This is a critical pillar of the 1998 Good Friday Agreement, which ended decades of sectarian conflict in Northern Ireland between the largely Protestant population who wanted to stay within the UK, and Catholics, who identified more closely with the Republic of Ireland.

Brexit threatened this open border and the past two decades of relative peace, so both sides agreed to include a “backstop” — basically, a guarantee that even if the EU and the UK don’t reach a trade agreement, an open border between Northern Ireland and Ireland will remain in place, no matter what.

The “backstop plan” will call for the entire UK to stay in the EU customs union for goods. But Northern Ireland will still remain within some parts of the EU single market, which means it will have to follow somewhat stricter regulatory standards compared to the rest of the UK.

This has created a brand new Brexit metaphor: the “swimming pool.” Think of Northern Ireland in the deep end, having to follow more EU regulations, and the rest of the UK in the shallow end, with less stringent rules.

The UK will also have to follow this arrangement until an independent panel is assured there’s no chance of any return to a hard Irish border, but it can’t unilaterally withdraw from the setup.

The status of millions of EU citizens living in the UK and UK citizens living in the EU

Broadly speaking, EU nationals who’ve lived in the UK for five years can remain with their families. Britons will also be allowed to stay in the EU country where they currently live.

Divorce settlement

This is how much the UK will pay the EU for forcing everyone to go through this whole process. This is expected to be at least 39 billion pounds, which is about $50 billion.

An outline for future negotiations

There is also a short political declaration attached to the withdrawal agreement that offers the broad guidelines for the future EU-UK relationship, which will be hammered out after the UK formally leaves the EU on March 29.

Think of it this way: This proposed Brexit deal is laying out the terms of the divorce. Once that’s finalized, the EU and UK can sit down and figure out their post-breakup relationship, specifically what kind of trade relationship they want.

So what’s the problem here?

May presented the draft Brexit proposal to her cabinet on Wednesday over the course of a five-hour session, and appeared to win their support.

“When you strip away the detail, the choice before us is clear,” May told reporters after the meeting. “This deal, which delivers on the vote of the referendum, which brings us back control of our money, laws and borders, ends free movement, protects jobs, security, and our union — or leave with no deal, or no Brexit at all.”

But the resignations of her cabinet ministers— including her Brexit secretary, who was the second Brexit secretary to quit her government — showed just how split her party is over this proposed plan.

Raab’s departure, in particular, is extremely destabilizing for May, as he was literally supposed to help negotiate the deal he now rejects. He’s also fairly conservative himself, and May hoped he could help sell her Brexit plan to more skeptical hardliners in her party.

Instead, he’s decided he’s had enough.

“I cannot reconcile the terms of the proposed deal with the promises we made to the country our manifesto at the last election,” Raab wrote to May in his resignation letter. “This is, at its heart, a matter of public trust.”

Today, I have resigned as Brexit Secretary. I cannot in good conscience support the terms proposed for our deal with the EU. Here is my letter to the PM explaining my reasons, and my enduring respect for her. pic.twitter.com/tf5CUZnnUz — Dominic Raab (@DominicRaab) November 15, 2018

Raab is not alone, and in addition to McVey and a few junior ministers, more resignations are still possible, emboldened by Raab.

The bottom line: Hardline Brexiteers in May’s party loathe this proposal. They see it as tying the UK to the EU indefinitely and sacrificing the sovereignty Brexit was supposed to help reinstate. Instead, the UK could be forced to submit to EU rules and regulations without any benefit of decision-making power. One conservative lawmaker called it a “Hotel California” deal, as in you can check out but can never really leave (the EU).

May has supporters within her party who agree that this deal is basically the best the UK can get if it wants to leave the EU and minimize economic pain and avoid a no-deal scenario.

And then there’s the Labour Party. Opposition leader Jeremy Corbyn has also rejected the deal, calling it a “leap into the dark.” May will likely need Labour votes to pass the deal if enough hardline Tory members abandon her. But Corbyn and Labour (which have their own divisions on Brexit) are mostly free to let May and the Conservatives implode.

“They want the Tories to sit on this and die,” Newman, the Georgetown professor, told me.

Now Theresa May’s deal is in trouble — as is her prime ministership

May defended her Brexit deal in Parliament on Thursday, getting hounded by criticism on all sides. But she continued to repeat her message: that this is the best that the UK can do if it wants a deal, and it still wants to Brexit.

That has not stopped those who oppose it from trying to find a different path forward, specifically the hardliners. Not only have they said they’ll vote down this proposal in Parliament, but some are now calling for a “no confidence” vote.

This is basically a rebellion from within May’s own party. These MPs are claiming that they no longer believe she’s capable of carrying out her duties because of what they see as a shoddy Brexit deal, and are now undertaking a formal process to try to remove her.

Members of Parliament have to submit formal letters to the party’s parliamentary committee and lay out their case against May. A total of 48 letters can trigger a “no confidence” vote, but it would require a majority of her Conservative Party (at least 158 members) to force her to resign from the prime ministership.

Jacob Rees-Mogg, a vocal Brexiteer, is leading the charge, joined by a growing number of hardline Tories who’ve said May has broken her promises on Brexit and so is unfit to lead. May’s opponents reportedly haven’t reached the threshold to trigger that “no confidence” vote yet, but it’s still early.

But a lot of this is for show. Even if a no-confidence vote happens, it seems unlikely that May will lose her job. As this turmoil makes painfully clear, the Tories are fractured, so finding a replacement who would have majority support is its own challenge. May, then, is in a terrible position, but she made clear on Thursday she plans to fight for her deal.

“It’s still feasible that May will hold on,” Newman said, “and once the alternatives are put in front of the leaders of the party, they’ll continue down this road of the current deal.”

The European Union is, in some ways, backing up May, basically saying, figure it out at home, but this deal is “the best we can do.”

A summit is still scheduled for the end of November, where EU and UK negotiators will finalize the Brexit deal and get the sign-off of the EU member states. (Though some EU countries, including France, are not all that thrilled with the draft agreement either.)

If this chaos in May’s government intensifies, it could threaten that November summit, leaving the UK and the EU at loggerheads and inching closer to no-deal Brexit.

But this might also be the hardline Brexiteers’ last stand before they, and other skeptics, accept reality: It may be a choice between this flawed plan and the UK leaving the EU empty-handed.