British Prime Minister Theresa May is under pressure from all sides, including hard-line Brexiteers within her own conservative party. May’s era as prime minister has been declared over before, and she has shown no signs of giving in to her critics.

But staying in office isn’t entirely up to May herself. There are two key scenarios that might result in her departure.

Chances of the first scenario — a no-confidence vote triggered by her own party — increased on Friday, as at least 20 letters were submitted by Conservative Party members of Parliament, demanding a vote on May’s future. That’s still far from the required threshold of 48 letters (or 15 percent of all Tory MPs), but delegates are not required to make their submissions public.

So, when key party officials were ordered back to London on Friday morning, warning signs mounted that a leadership vote may be imminent. Triggering the procedure alone would not topple the British prime minister, as she could survive if a simple majority of Tory MPs backed her.

A substantial number of lawmakers would likely opt to keep May in power to prevent a so-called “no-deal” Brexit, which has been embraced by some hard-line conservative MPs. As a new British government would probably not have sufficient time to negotiate a new deal with the European Union on the country’s terms of departure, the nation would crash out of the bloc -- potentially resulting in food shortages and job losses, according to some governmental scenarios. On top of that, any successor would face the same unrealistic expectations from all sides of the political spectrum that have derailed May’s plans.

But hard-line MPs in favor of getting rid of May would point to a Tory rule that would prevent another leadership challenge for at least a year. Following substantial election losses last year, May’s era was widely believed to be doomed. Her party critics — who are far more numerous than the hardcore Brexiteers behind the current challenge — may be unwilling to essentially grant her at least another year in office.

And while May might survive the rebellion on paper, an unexpectedly high number of votes against her would put additional pressure on her to resign.

Even if May did not face a Tory challenge or survived it, her government may still run into another obstacle that is also connected to last year’s election outcome. After May’s Conservatives fell short of a parliamentary majority, the prime minister negotiated a “confidence and supply” power-sharing agreement with Northern Ireland’s Democratic Unionist Party.

The DUP has threatened to withdraw from that agreement several times. The party reportedly repeated those threats this week, indicating that it may withdraw unless May is removed as party leader because her deal with the E.U. may result in some regulatory checks between Northern Ireland and the rest of the United Kingdom.

The DUP believes that such checks could tear the country apart. If the DUP were to withdraw from its agreement with the Conservative Party, the Tories could still try to agree on a similar deal with another opposition party — but none of those parties are in favor of the Tory hard-liners' Brexit vision, either. Ousting May that way would increase the chances of new elections and, perhaps, of a second referendum.

Read more:

Can Brexit be stopped? A guide for those just waking up to Britain’s political nightmare.