LONDON — Brexit destroyed the careers of two recent British prime ministers, so resolving one of its most poisonous legacies was never going to be easy for the latest, Rishi Sunak.
Predictably enough, things are not going to plan.
Throughout Britain’s tortuous exit from the European Union, successive prime ministers have sought to broker a deal with the bloc over a festering dispute: trade rules for Northern Ireland, where treatment of the border with Ireland, an E.U. member, has bedeviled negotiators for years.
An agreement was expected this week, until leaks of its contents prompted a backlash from Northern Irish politicians and some of Mr. Sunak’s own lawmakers.
The question now is whether Mr. Sunak will push ahead with the deal, knowing that it could destabilize his leadership, providing a harsh reminder of the difficulties of solving one of the most intractable consequences of Brexit.
All of his predecessors since 2016 have had to wrestle with Brexit, and the issue cost two, David Cameron and Theresa May, their jobs as prime minister.
“It would be a massive gamble, it would be a gamble on the fate of his prime ministership,” said Anand Menon, a professor of European politics and foreign affairs at King’s College London. “And it’s a gamble he has made without thinking about the odds or trying to stack the cards.”
Even a modest internal rift would be another setback for a prime minister criticized over his party’s poor poll ratings, the country’s stagnant economy and the worst labor unrest in recent memory. But angering hard-line Brexit supporters could prompt ministerial resignations or even a leadership challenge against Mr. Sunak, Professor Menon said.
“Whether it is worth risking his whole premiership on this, I’m not sure.”
Backing away now has dangers, too, because it could sap Mr. Sunak’s authority.
“There is a lot to gain for the prime minister diplomatically and economically,” said Katy Hayward, a professor of political sociology at Queen’s University Belfast. “If he abandons all the progress at the behest of a minority of backbenchers, then that’s setting the course for the rest of his premiership as a weak prime minister.”
The prize would be considerable if Mr. Sunak could, in the words of another former prime minister, Boris Johnson, get Brexit done.
Easing concerns in Northern Ireland among politicians from the Democratic Unionist Party, who are determined to preserve their status within the United Kingdom, could help restore a power-sharing government in Belfast. (The D.U.P. is currently refusing to take part in protest at the trade rules.)
An agreement would avert the prospect of a trade war between Britain and the European Union, and satisfy President Biden, who has urged a solution to the impasse. It might also clear the way for a presidential visit around the 25th anniversary of the Good Friday Agreement that helped end decades of bloodshed in Northern Ireland known as the Troubles.
At the heart of the negotiation is the so-called Northern Ireland protocol, which Mr. Johnson agreed to and which aims to avoid the need for customs controls on goods crossing the politically sensitive border between Northern Ireland and Ireland.
The effect was that Northern Ireland, which remained part of the United Kingdom, also stayed within parts of Europe’s single market, abiding by its economic rule book.
Though Mr. Johnson insisted to the contrary at the time, the protocol created a different trade barrier by requiring checks on goods moving from Britain to Northern Ireland, angering much of Northern Ireland’s pro-Unionist community, which saw its status within the United Kingdom as being undermined.
Leaks of Mr. Sunak’s proposed deal with Brussels suggest that goods moving from Britain to Northern Ireland with the intention that they remain there would pass through a “green” channel without routine checks. Those ultimately destined for Ireland, and therefore Europe’s single market, would pass through a “red” channel with more controls.
The agreement would minimize — though not eliminate — the role of the European Court of Justice, the bloc’s top judicial authority, in determining trade disputes. Northern Ireland’s politicians could have greater consultative powers before having to implement any new or updated European legislation.
But that does not seem enough for the D.U.P., which, despite holding only eight of 650 seats in Britain’s Parliament, has influence over a hard-line pro-Brexit caucus of Conservative lawmakers known as the European Research Group.
Many D.U.P. supporters would like to see the protocol completely scrapped.
“The D.U.P. haven’t prepared the ground for accepting the deal,” said Professor Hayward. The party’s voters, she said, “are very much of the view that the protocol needs to be removed before power sharing is restored.”
Mr. Sunak also appears to have upset the party by leaving consultations until late last week, when an outline deal was already on the table in Brussels. According to news reports, talks with D.U.P. politicians in Belfast’s Culloden Hotel went badly.
“He clearly flew over there and had a meeting which, by the more recent accounts, wasn’t great,” said Professor Menon.
The D.U.P. members are experienced negotiators and they “expect to be around the table and to be consulted and trusted with some behind-the-scenes information,” said Professor Hayward.
“They really didn’t want to be presented with a done deal,” she said.
Nor does Mr. Sunak appear to have consulted widely among his own Conservative backbenchers until recent days. One former stalwart of the hard-line group, Chris Heaton-Harris, is now the Northern Ireland secretary, and his role in negotiations could reassure many Brexit-supporting Conservative lawmakers.
But a significant number of Conservative lawmakers are dissatisfied with Mr. Sunak for a variety of reasons.
Some blame him for the ouster of Mr. Johnson, whose supporters see him as a leader who could turn around the Conservative Party’s electoral fortunes.
Mr. Johnson himself has stirred the pot by defending legislation he introduced that would enable the British government to override some of the protocol. That bill is moving through Parliament, but Brussels wants it removed as a part of the new agreement.
According to British news reports, Mr. Johnson has said axing it would be a “great mistake” — an intervention that prompted a warning from George Osborne, a former chancellor of the Exchequer.
“He wants to bring down Rishi Sunak, and he will use any instrument to do it,” Mr. Osborne recently told the broadcaster Channel 4. “If the Northern Ireland negotiations are that instrument, he will pick it up and hit Mr. Sunak over the head with it.”
The continuing discord over the protocol underscores the ideological grip Brexit retains over the Conservative Party, even at a time when polls show a majority of voters now regard leaving the European Union as a mistake.
Mr. Sunak was a supporter of the Brexit campaign during the 2016 referendum, yet even he is viewed with suspicion by some hard-liners because he wants to strike a deal with Brussels and move on.
By contrast, the most hard-line Brexit supporters remain hostile to accommodation with the European Union and wedded to a more purist vision of sovereignty, post-Brexit deregulation and tax cutting, taking Britain ever further from Europe’s economic orbit.
“It says something about the state of Brexit almost seven years after the referendum,” said Professor Menon, “that it is not that we cannot agree on Leave or Remain, it is that Brexit supporters can’t agree on Leave.”