LONDON (AP) — Britain’s foreign secretary warned the European Union on Thursday that the U.K. will have “no choice but to act” to revoke parts of a Brexit agreement on Northern Ireland if the EU does not show flexibility.

Post-Brexit arrangements for border and customs checks in Northern Ireland have become “the greatest obstacle” to forming a new government in Belfast, Foreign Secretary Liz Truss said during a call with European Commission Vice President Maros Sefcovic.

Border issues between Northern Ireland, which is part of the United Kingdom, and EU member Ireland have long posed the thorniest problems in the U.K.’s divorce from the EU.

They resurfaced after the Democratic Unionist Party refused this week to help form a power-sharing government with Irish nationalist party Sinn Fein unless the post-Brexit arrangements were substantially changed or scrapped.

An open Irish border is a key part of the peace process that ended decades of violence in Northern Ireland, which is the only part of the U.K. to share a land border with an EU country. The EU and the U.K. agreed to keep the Irish border free of customs posts and other checks after Brexit, which became final at the end of 2020.

Instead, there are checks on some goods, such as meat and eggs, entering Northern Ireland from elsewhere in the U.K. The Democratic Unionist Party is strongly opposed to the rules, saying the checks have created a barrier that undermines the British identity of its members.

Truss’ office said Sefcovic reiterated to her Thursday that “there was no room to expand the EU negotiating mandate or introduce new proposals to reduce the overall level of trade friction.”

“The foreign secretary noted this with regret and said the situation in Northern Ireland is a matter of internal peace and security for the United Kingdom,” the Foreign Office said in a statement.

“If the EU would not show the requisite flexibility to help solve those issues, then as a responsible government we would have no choice but to act,” the statement said.

Tensions over the trade rules, known as the Northern Ireland Protocol, were ramping up even before Northern Ireland held its assembly elections last weekend.

Northern Ireland has been without a functioning government since February, when the DUP’s leader at the time, Paul Givan, quit as first minister in protest over the trade rules.

U.K. officials have repeatedly warned they might unilaterally suspend the arrangements if the EU did not agree to major changes.

British media reported that British Prime Minister Boris Johnson could announce next week that his government would legislate to override parts of the Northern Ireland deal.

The Times newspaper reported Thursday that Britain’s Attorney General, Suella Braverman, issued advice saying that such a move would be legal because the EU was undermining Northern Ireland’s Good Friday peace agreement by creating a trade barrier in the Irish Sea.

Any move by Britain to unilaterally rewrite the rules would bring legal action from the EU that could escalate into a trade war.

“I am convinced that only joint solutions will work. Unilateral action, effectively disapplying an international agreement such as the protocol, is simply not acceptable,” Sefcovic, the EU’s chief negotiator, said after Thursday’s call.

The DUP’s leader, Jeffrey Donaldson, said his party would decide whether to nominate a Speaker for the Northern Ireland Assembly on Friday, when the legislature is due to have its first session since last week’s elections.

Donaldson has said that the party will not nominate ministers to Northern Ireland’s devolved government until the U.K. government acts over the Brexit deal.

According to rules agreed under Northern Ireland’s 1998 peace agreement, no functioning government could form unless the largest British unionist party and largest Irish nationalist one come together to share power.