LONDON (AP) 鈥 The U.K. and the European Union sealed a deal on Monday to resolve their thorny post-Brexit trade dispute over Northern Ireland, hailing the agreement as the start of a 鈥渘ew chapter鈥 in their often fractious relationship.

British Prime Minister Rishi Sunak and European Commission President Ursula von der Leyen announced the grandly titled 鈥淲indsor Framework鈥 after agreeing to the final details in Windsor, near London.

Von der Leyen told a news conference it was 鈥渉istoric what we have achieved today.鈥 Sunak said there had been a 鈥渄ecisive breakthrough.鈥

The agreement, which will allow goods to flow freely to Northern Ireland from the rest of the U.K., ends a dispute that has soured U.K.-EU relations, sparked the collapse of the Belfast-based regional government and shaken Northern Ireland鈥檚 decades-old peace process.

Fixing it ends a long-running irritant for von der Leyen and is a big victory for Sunak 鈥 but not the end of his troubles. Selling the deal to his own Conservative Party and its Northern Irish allies may be a tougher struggle. Now Sunak awaits the judgment of Northern Ireland鈥檚 Democratic Unionist Party, which is boycotting the region鈥檚 power-sharing government until the trade arrangements are changed to its satisfaction.

Sunak is due to make a statement to the House of Commons later setting out details of the deal.

Northern Ireland is the only part of the U.K. that shares a border with an EU member, the Republic of Ireland. When the U.K. left the bloc in 2020, the two sides agreed to keep the Irish border free of customs posts and other checks because an open border is a key pillar of Northern Ireland鈥檚 peace process.

Instead, there are checks on some goods entering Northern Ireland from the rest of the U.K. That angered British unionist politicians in Belfast, who say the new trade border in the Irish Sea undermines Northern Ireland鈥檚 place in the United Kingdom.

The Democratic Unionist Party a year ago in protest and has refused to return until the rules are scrapped or substantially rewritten.

The party's leader, Jeffrey Donaldson, said there had been 鈥渟ignificant progress鈥 but 鈥渒ey issues of concern鈥 remained. He said the party would study the details before responding.

The devil, as ever, will be in those details, and the two sides emphasized different elements of the deal.

Sunak said the new rules 鈥渞emoved any sense of a border in the Irish Sea鈥 by eliminating checks and paperwork for the vast majority of goods entering Northern Ireland. Only those destined to travel onward to EU member Ireland will be checked.

He said Northern Ireland鈥檚 lawmakers would be able to block any changes to EU goods laws that applied to them by using an emergency mechanism labeled the 鈥淪tormont Brake鈥 after the home of the Northern Ireland Assembly.

鈥淭oday鈥檚 agreement delivers smooth-flowing trade within the whole United Kingdom, protects Northern Ireland鈥檚 place in our union and safeguards sovereignty for the people of Northern Ireland,鈥 Sunak said.

Von der Leyen stressed that the EU鈥檚 borderless single market would be protected by safeguards including 鈥淚T access, labels and enforcement procedures鈥 and said the European Court of Justice would remain 鈥渢he sole and ultimate arbiter of EU law.鈥

The role of the European court in resolving any disputes that arise over the rules has been the thorniest issue in the talks. The U.K. and the EU agreed in their Brexit divorce deal to give the European court that authority. But the DUP and Conservative Party euroskeptics insist the court must have no jurisdiction in U.K. matters.

The British pound rose against the dollar after the deal was announced, and business groups welcomed the agreement. Tony Danker, who heads the Confederation of British Industry, said it would 鈥渁llow businesses and politicians to turn their attention to economic growth and delivering greater prosperity.鈥

Sunak will have to face down his Conservative critics 鈥 including former Prime Minister Boris Johnson, who as leader at the time signed off on the trade rules that he now derides. Johnson was ousted by the Conservatives last year over ethics scandals, but is widely believed to hope for a comeback.

In a boost for Sunak鈥檚 chances of winning Conservative support, lawmaker Steve Baker 鈥 a self-styled 鈥淏rexit hardman鈥 who helped topple Prime Minister Theresa May by opposing her Brexit deal in 2019 鈥 said he was 鈥渄elighted鈥 with the agreement.

Sunak said lawmakers in Parliament would get a vote on the deal 鈥渁t the appropriate time,鈥 but not right away.

Even if Sunak faces a rocky road at home, the deal likely marks a dramatic improvement in relations with the EU. They were severely tested during the long Brexit divorce and chilled still further amid disputes over the Northern Ireland Protocol.

Under Johnson, the U.K. government introduced a bill that would let it unilaterally rip up parts of the Brexit agreement, a move the EU called illegal. Sunak's government said the bill would now be dropped.

Von der Leyen said the deal was 鈥済ood news for scientists and researchers鈥 because it would allow the U.K. to be readmitted to the bloc's Horizon science program. The EU had been blocking that until the trade dispute was fixed, to the chagrin of British scientists.

After sealing the deal, Von der Leyen had tea with King Charles III at Windsor Castle, 20 miles (32 kilometers) west of London. Buckingham Palace said the meeting was taking place on the government鈥檚 advice, leading critics to accuse Sunak of dragging the monarch, who is supposed to remain neutral, into a political row.

Sunak鈥檚 spokesman, Max Blain, said the government 鈥渨ould never鈥 embroil the king in politics.

鈥淗is Majesty has met with a number of foreign leaders recently,鈥 he said, including Polish President Andrzej Duda and Ukraine鈥檚 Volodymyr Zelenskyy. 鈥淭his is no different.鈥

___

Associated Press writer Raf Casert in Brussels contributed.

Follow AP鈥檚 coverage of Brexit at and of British politics at

The 好色tv Press. All rights reserved.