BRUSSELS - Britain and the European Union hammered out a deal early Friday that allows Brexit talks to finally move on to the all-important issues of trade and the future relationship between the two. But some of the details appeared contradictory, and many of the toughest issues remained unresolved.

The last stumbling block had involved the border between Ireland -- an EU member -- and Northern Ireland, which is part of the UK. After Britain leaves the EU, that will be the only land border between the two.

The Northern Ireland party that has been holding up a deal now says it's satisfied. Negotiators also reached broad agreement on the rights of British citizens in EU countries and EU nationals in the UK, as well as on Britain's future financial obligations to the EU.

Get Breaking News Delivered to Your Inbox

As a result, the European Commission recommended that the talks move onto the next phase. Leaders of the 27 remaining EU member states are expected to ratify that decision at a meeting in Brussels.

"I believe that we have now made the breakthrough that we needed," EU Commission President Jean-Claude Juncker told reporters during a news conference with British Prime Minister Theresa May.

The agreement is intentionally vague on key points, and some of the details appeared to be mutually contradictory.

On the one hand, Britain promises to withdraw from the EU single market and the broader customs union. On the other, the agreement says there will be no hard border between Ireland and Northern Ireland, although the former will remain within the EU single market and the latter in the UK.

Exactly what that means will be fought over by politicians and negotiators in the months to come, and the European Commission itself acknowledged in a message to EU leaders that the language "seems hard to reconcile with the United Kingdom's communicated decision to leave the internal market and the Customs Union."

The pound rose initially on the news of a breakthrough but later fell back as investors digested the details of the deal. It was recently trading at $1.3465, unchanged on the previous day.

The wording of the agreement left people close to the negotiations on both sides of the argument happy, and people further from the negotiations on both sides angry.

"I very much welcome the prospect of moving ahead to the next phase, to talk about trade and security and to discuss the positive and ambitious future relationship that is in all of our interests," May said.

Nigel Farage, who led the drive to leave the EU as chairman of the UK Independence Party, said May had caved on critical points. Farage tweeted that the deal was "good news for Mrs. May as we can now move on to the next stage of humiliation."

On the other side, anti-Brexit London Mayor Sadiq Khan said it is "extremely disappointing" that Britain is pledging to leave the single market and customs union.

"Despite the progress today, it looks increasingly unlikely that we will get a deal that works in London's best interests and protects jobs and growth across Britain," he said.

Britain committed once again in the agreement to leave the EU on March 29, 2019. Negotiations must be wrapped up within a year to leave time for parliaments to endorse any deal.

Already, precious time has been lost in matters many thought would be dealt with expeditiously. The real drama lies ahead, with trade talks that normally can take a decade or more compressed into a matter of months.

European Council President Donald Tusk grimly pointed out that 18 months had already passed since Britain's vote to leave the EU and that now the parties must negotiate a transition arrangement in less than a year.

"The most difficult challenge is still ahead," Tusk said. "We all know that breaking up is hard, but breaking up and building a new relation is much harder."