Britain and the European Union have struck a last-minute agreement to stave off a breakdown in negotiations over Brexit, agreeing there will be no "hard border" between Northern Ireland and the Republic of Ireland.

As NPR's Frank Langfitt reports from London, "the fear [had been] that when the U.K. leaves the European Union, customs posts would go up dividing Northern Ireland and the Republic of Ireland."

It was one of the most contentious of a number of issues that could make it difficult to reach a final "divorce" agreement by March 2019.

The Republic of Ireland had vowed to veto any deal creating a hard border with customs checkpoints. British Prime Minister Theresa May was also apparently able to satisfy Northern Ireland's Protestant lawmakers.

"In Northern Ireland we will guarantee there will be no hard border and we uphold the Belfast agreement in doing so," May said at a joint news conference in Brussels with European Commission President Jean-Claude Juncker.

The 1998 Belfast Agreement, also known as the Good Friday Agreement, brought peace to Northern Ireland after decades of strife. It ensured cross-border cooperation between the independent Republic of Ireland and Northern Ireland, which is part of the U.K.

"Reaching this agreement now ensures that businesses will be able to make investment decisions based on an implementation period that offers welcome certainty," she said.

Juncker insisted that the deal still would need to be approved by EU member states, saying, "The decision on sufficient progress will be in the hands of the 27 heads of state or government," which are to meet at a summit next Thursday.

The EU's chief Brexit negotiator, Michel Barnier, said Friday that "the progress achieved today is sufficient to move to the next phase" of talks, but cautioned that more work remains to be done "on a number of issues."

European Council President Donald Tusk said: "Breaking up is hard, building a new relationship is much harder."

Friday's agreement would also ensure that EU citizens living in the U.K. and U.K. citizens in the rest of the EU would have the right to stay, according to The Guardian. The newspaper notes that "Rights of their children and those of partners in existing 'durable relationships' are also guaranteed."

Among the other issues resolved in Friday's breakthrough are that the U.K. will continue to pay into the EU budget for 2019 and 2020 and that London agrees to pay its liabilities, such as pensions.

May said the financial settlement would be "fair for the British taxpayer."

Copyright 2017 NPR. To see more, visit