Britain and the European Union finally reached a new tentative Brexit deal on Thursday, hoping to escape the acrimony, divisions and frustration of their three-year divorce battle. British Prime Minister Boris Johnson now faces the Herculean task of selling the accord to his recalcitrant parliament β€” including his allies in Northern Ireland.

Only hours before Brussels hosted a summit of the bloc’s 28 national leaders, European Commission President Jean-Claude Juncker tweeted: “We have one! It’s a fair and balanced agreement for the EU and the UK and it is testament to our commitment to find solutions.”

Johnson tweeted that the two sides had struck a “great new deal” and urged U.K. lawmakers to ratify it in a special session being held Saturday β€” only the first time since 1982 that British lawmakers have been at work on that day.

“This is a deal which allows us to get Brexit done and leave the EU in two weeks’ time,” Johnson tweeted.

The pound hit a five-month high against the U.S. dollar on the news.

Yet immediately complicating matters was Johnson’sΒ Northern Irish governmentΒ allies, which didn’t waste a minute before announcing they could not back the tentative Brexit deal because of the way it handled the Irish border.

Johnson, however, needs all the support he can get to push any Brexit deal past a deeply divided Parliament and that knowledge tempered jubilation at the EU summit. The U.K. Parliament already rejected a previous Brexit deal crafted by former British Prime Minister Theresa May three times.

EU Brexit negotiator Michel Barnier has been through this scenario before.

“We have this history. That is why my mountaineering temperament keeps me careful and cautious,” said Barnier, who hails from the French Alps and organized the 1992 Olympic Winter Games there.

Barnier was in the room when the leaders called each other and said Johnson “told President Juncker this morning that he believed he was able to get the deal approved,” adding Johnson said he was “confident about his capacity to convince a majority.”

The agreement must still be formally approved by the bloc and ratified by the European Parliament.

The key hurdle to a Brexit deal was finding a way to keep goods and people flowing freely across the border between EU member Ireland and the U.K.’s Northern Ireland after Brexit. That invisible, open border has underpinned the region’s peace accord and allowed the economies of both Ireland and Northern Ireland to grow.

Johnson insists that all of the U.K. β€” including Northern Ireland β€” must leave the bloc’s customs union, which would seem to make border checks and tariffs inevitable.

But Barnier said the deal “squares this circle” by leaving Northern Ireland inside the EU single market for goods β€” so border checks are not needed β€” and also eliminating customs checks at the Irish border. Instead, customs checks will be carried out and tariffs levied on goods entering Northern Ireland that are destined for the EU.

That effectively means a customs border in the Irish Sea β€” something the British government long said it would not allow and something Northern Ireland’s Democratic Unionist Party vehemently opposes.

DUP leader Arlene Foster and the party’s parliamentary chief Nigel Dodds said they “could not support what is being suggested on customs and consent issues,” referring to a say the Northern Irish authorities might have in future developments on the border.

The party said their position was unchanged after the announcement of the provisional deal.

But the EU has compromised, too, by allowing Northern Ireland special access to its single market. And the deal gives Northern Ireland a say over the rules, something that was missing from May’s previous rejected agreement. After four years, the Northern Ireland Assembly will vote on whether to continue the arrangement or end it.

Johnson β€” who took office in July vowing that Britain would finally leave the EU on Oct. 31 with or without a deal β€” on Wednesday likened Brexit to climbing Mount Everest.

Legislator Bim Afolami quoted the prime minister as saying “the summit is in sight, but it is shrouded in cloud. But we can get there.”

Β© The Associated Press. All rights reserved.