Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LONDON — The U.K. and European Union announced a breakthrough in Brexit talks early Friday, resolving the contentious issue of the Irish border which earlier this week threatened to derail the divorce negotiations.

In a series of late-night phone calls, British Prime Minister Theresa May — along with Irish and E.U. leaders — hashed out how Brexit will affect the 310-mile border between Northern Ireland, which is part of the U.K., and the Irish Republic, which is not. Until now, the dispute had blocked significant progress on Brexit.

“I believe that we have now made the breakthrough that we needed,” European Commission President Jean-Claude Juncker told reporters in Brussels.

British Prime Minister Theresa May and EU Commission President Jean-Claude Juncker speak to reporters in Brussels, Belgium, on Friday. Olivier Hoslet / EPA

Juncker said that “sufficient progress has been achieved” on three key issues at the heart of Britain leaving the 28-country bloc to recommend that talks proceed to determine their future relationship and a trade deal.

E.U. leaders are due to meet in Brussels next Thursday and are expected to endorse Juncker's assessment that enough progress has been made on the terms of Britain’s financial settlement, the status of Irish borders and the rights of citizens hit by Brexit.

But European Council President Donald Tusk cautioned that “the most difficult challenge is still ahead.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

May said getting to this point had required "give and take from both sides."

The British prime minister said the agreement guaranteed that there would be no so-called “hard border” on the island of Ireland, which many feared would spark a return to the sectarian violence known as “The Troubles” that plagued the region during much of the late 20th century.

Existing rules allow people and goods to pass freely between the Irish Republic and Northern Ireland with no border checks. Ireland wants to preserve the current arrangement, which has eased tensions along the border. May is struggling to balance those demands against the concerns of Northern Ireland's Democratic Unionist Party, which she relies on to support her government in Parliament.

Earlier this week, the DUP scuttled a deal between the U.K and the bloc, prompting the frantic diplomacy.

DUP leader Arlene Foster appeared satisfied Friday, saying that the agreement gave "very clear confirmation that the entirety of the United Kingdom is leaving the European Union."

However, the agreement doesn’t give details of how the thorny border issue will be solved, noting that much depends on the outcome of trade talks between Britain and the E.U.

Britain and the E.U. also came to an agreement on the rights of citizens hit by Brexit.

"So far so good, but very little has been resolved"

May said the three million E.U. citizens living in the U.K. will have their rights enshrined in U.K. law and enforced in British courts. “They will be able to go on living as before,” she said. Crucially, the U.K. agreed that the European Court of Justice would have final jurisdiction on the issue for eight years after Brexit.

The agreement also stipulated that the so-called divorce bill — how much the U.K. owed the European Union — will be paid over time, rather than in a lump sum. An official figure for the total cost of this commitment has not been released. However, British newspapers recently suggested the divorce bill would be around 50 billion euros — or $59 billion.

Britain will leave the E.U. on March 29, 2019, but negotiations must be wrapped up within a year to leave time for parliaments to endorse any deal.

Anand Menon, the director of U.K. in a Changing E.U., a research group based at King's College London, said he thought Juncker and May’s agreement made a final deal on Brexit more likely. However, what that would look like remained unclear.

“This is simply a progress report," he said. “So far so good, but very little has been resolved.”

Edward Burke, a professor of international relations at the University of Nottingham, said the agreement went a long way to address the concerns of future British-Irish relations and to maintaining peace in Northern Ireland.

“We’ve managed to roll back on the poisonously acrimonious series of negotiations we’ve had for almost a year and a half and finally have some real clarity and meat on the bone on how the U.K. is going to advance in its Brexit negotiations,” he added.