Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LONDON — Just days before a crucial deadline in Brexit negotiations, British Prime Minister Theresa May is facing what some analysts say is an unsolvable problem that endangers her government and grip on power.

The U.K. last year voted to leave the European Union and is now locked in complex talks with the 27 other members of the bloc about how this divorce will work.

The entire process has divided the country, with bitter discord between anti-Brexit "remainers," including many who say the task is impossible and allege the British negotiators are incompetent, and "leavers," who accuse these naysayers of unpatriotic pessimism. Brexit is due to occur in March 2019.

A key issue that has been bubbling under the surface for months threatened to boil over this week.

A boardwalk leading to the mountaintop border with the Irish Republic near Florencecourt, Northern Ireland. Clodagh Kilcoyne / Reuters

How Brexit affects the 310-mile border between Northern Ireland, which is part of the U.K., and the Irish Republic, which is not, has seen May pulled in several directions by different allies. It appears she can't please all of them, but if any of these players are not satisfied then it could have fatal consequences for her government.

"It's a perfect storm," according to Anand Menon, the director of U.K. in a Changing E.U., a research group based at King’s College London.

May's Conservatives do not have a majority of lawmakers in the British Parliament. She relies on support from a Northern Irish political party to prop up her government and keep her as prime minister.

Her underlying problem is this: Where should the border between a post-Brexit U.K. and the E.U. lie? The British government wants different rules than the E.U. on the free movement of goods and people, and that would require some form of checkpoint.

Between the U.K. and the European continent, the answer is easy: The English Channel provides a distinct, watery boundary separating Britain from France, the Netherlands and Belgium, and beyond them Germany, Spain and Italy.

Related: Professionals wave goodbye to U.K., head to Europe

But elsewhere things get tricky fast.

Northern Ireland is set to leave the E.U. but the Irish Republic is staying put in the bloc. Their border is currently all but invisible.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

British and Irish officials say they don't want this to turn into a so-called "hard border" because they fear a return to the sectarian violence known at "The Troubles" that plagued the region during much of the 20th century. It would also mean untangling the pair's shared rules on everything from healthcare to transport.

So if the prime minister can't make the Irish border her boundary with the E.U., could she put the border somewhere else?

This question is one of the key areas where Europe is demanding "sufficient progress" before it allows negotiators to move onto the next stage in the talks.

May was hoping to show she had achieved this goal before E.U. leaders met for a crucial summit next week. One senior E.U. diplomat told Reuters it was the "deadline of deadlines."

On Monday, a draft proposal was leaked suggesting that the Irish problem could be solved by giving Northern Ireland special status with its southern neighbor.

This caused an uproar, because May's power depends on a relatively small group of lawmakers from the Democratic Unionist Party, a right-wing Northern Irish party more commonly known as the DUP.

May lost so much power during elections in June that she needs to keep the DUP happy to help her pass laws and ultimately hold onto power.

Related: Fruit left to rot as Brexit squeezes seasonal labor

These DUP kingmakers stand against same-sex marriage and oppose lifting the near-total ban on abortion in Northern Ireland, but more than anything they oppose all that would weaken the bond between their province and the rest of the U.K. — the clue is in their "Unionist" name.

Special status for Northern Ireland would mean different regulations there and the creation of some sort of border between itself and the rest of the U.K. This is not an option for the unionists.

"Once we saw the text, we knew it was not going to be acceptable," DUP leader Arlene Foster told Irish broadcaster RTE on Tuesday after the proposal was leaked. She described the news as a "big shock."

Britain's Prime Minister Theresa May Kirsty Wigglesworth / AP

Not only did talks between May and European Commission President Jean-Claude Juncker break down Monday, but the reported offer to Northern Ireland also caused something of a domino effect in other regions of the U.K.

Scottish First Minister Nicola Sturgeon, Welsh First Minister Carwyn Jones and London Mayor Sadiq Khan all asked in effect: "If Northern Ireland gets special status, why can't we?"

The Scottish issue is of particular concern to some because if that region felt it was being short-changed, this might embolden supporters of its independence to push again for a new vote to split from the rest of the U.K.

Charles Grant, director of the Centre for European Reform think tank, said May is facing a balancing act that has "the potential to be very destabilizing far beyond the Brexit talks.”

He added: "All prime ministers need authority to do their jobs and people need to be a bit scared of them. If Theresa May cannot get the DUP to agree to the deal then people will start to mock her and her authority will evaporate.”

The issue of Europe has been a thorn in the side of May’s Conservative Party for decades.

Some Brexiteers will accept nothing less than what is known as a “hard Brexit” — that is, exiting the bloc’s single market, which guarantees free movement of goods and people, and the customs union. It's not clear what a special arrangement for some or all of the U.K. would look like, but a so-called "soft Brexit" retaining some of the status quo could be interpreted as a betrayal of those values.

Just as she needs the DUP, May relies on these Conservative lawmakers to keep her grip on power.

A mutiny by just a half a dozen of her Conservative colleagues would represent the first step toward May being ousted or perhaps another general election.

An E.U. supporter protests against Brexit near the Houses of Parliament in London on Tuesday. Matt Dunham / AP

"The reason no one has come up with a solution to the Irish question is because there isn't one, quite frankly," Menon said.

Grant agrees that there’s no way to please all the parties based on their current positions. In the short term, one way out of the Irish quandary, according to him, would be to come up with vague wording that “means all things to all people."

Then in the long run the U.K. could grant Northern Ireland the same rules as the Irish Republic in certain areas, such as agriculture, but maintain a hard border on everything else. This is something the DUP and other parties might accept, Grant said.