BRUSSELS -- British Prime Minister Boris Johnson's career of disdain for the European Union was a thing of the past on Thursday as he and the bloc's leaders celebrated their long-sought Brexit deal. He now faces an opponent closer to home: his own Parliament.

With the ink barely dry on the proposal and Johnson still happily backslapping EU leaders at a summit in Brussels, a chorus of British party leaders said they would vote against the deal. Crucially, the Northern Irish party that supports Johnson's minority government also stood opposed, leaving it uncertain if the prime minister would get the votes he needs to ratify the agreement.

After an intense week of talks and with only two weeks to go until Britain's scheduled departure on Oct. 31, European Commission President Jean-Claude Juncker broke the tension with a tweet Thursday morning: "We have one! It's a fair and balanced agreement for the EU and the UK and it is testament to our commitment."

The deal found a way to avoid a hard border between Ireland, an EU member, and the U.K.'s Northern Ireland. It crucially also lays a path for Britain's orderly departure, which Britons approved in a referendum more than three years ago.

European leaders unanimously endorsed the proposal on Thursday, formally sending it to the British Parliament, which will consider it in a special session Saturday.

Johnson, who has lost almost every important vote in Parliament since taking office in July, said he was confident he would succeed where his predecessor did not — Theresa May's proposal was voted down three times in Parliament.

"This is a great deal for our country. I also believe it's a very good deal for our friends in the EU," Johnson told reporters in Brussels. "There is a very good case for MPs across the House of Commons to express the democratic will of the people as we have pledged many times to do and to get Brexit done."

But it was shaping up to be a struggle. All the major opposition parties condemned the agreement, and Johnson's key ally, Northern Ireland's Democratic Unionist Party, also said its lawmakers would oppose it.

"It seems the prime minister has negotiated an even worse deal than Theresa May's, which was overwhelmingly rejected," Labour Party leader Jeremy Corbyn said.

Many opposition lawmakers want to oppose the deal and then seek to delay Brexit until there has been an election, a new referendum or new negotiations. Last month Parliament passed a law ordering the government to seek an extension to the Brexit deadline if Parliament doesn't approve a deal by Saturday.

But Juncker appeared to rule out any new postponement, leaving British lawmakers with a simple choice: deal, no deal or revoke Brexit.

"If we have a deal, we have a deal, and there is no need for a prolongation," he said. The ultimate decision on any extension, though, does not rest with Juncker. It's a decision for the other 27 EU countries.

Johnson's 10 Downing Street office put it even more succinctly with the mantra: "New deal, no deal — but no delay."

Johnson began his career as a Brussels-based journalist spinning exaggerated tales of EU excess for British readers, and as a politician helped lead the campaign to take Britain out of the EU, but that acrimony was nowhere in sight on Thursday.

Instead, relief was palpable in Brussels as leaders happily mingled in the summit room of the Europa building, which often been ground zero for European crises. Johnson cheerily saluted French President Emmanuel Macron, who responded with the heartiest of handshakes.

The jubilation soon turned bittersweet, with EU leaders bemoaning the impending loss of a major member state — a military, economic and diplomatic juggernaut that had joined 46 years ago.

"In my heart I will always be a Remainer and I hope that our British friends decide to return one day," European Council President Donald Tusk said, using the nickname for people who supported keeping Britain in the EU. "Our door will always be open."

EU Brexit negotiator Michel Barnier said he and his fellow Frenchmen would not forget "Britain's solidarity during the darkest hours," a reference to their alliance during World War II.

The pound hit a five-month high against the U.S. dollar on news of a Brexit deal, then sank back as traders heard Johnson's Northern Irish allies were still unhappy with the way the deal handles the border between Ireland and Northern Ireland — the only land border between the U.K. and the bloc and long one of the thorniest issues of any exit.

The new proposal is broadly similar to the 585-page withdrawal agreement that May hammered out, with the only major changes on the Irish border issue.

The agreement must also still be ratified by the European Parliament.

That could happen as early as next week when it meets in Strasbourg, though the legislature's chief Brexit official, Guy Verhofstadt, told The Associated Press that the body will take its full time to carefully examine and approve any divorce deal, even if that spills past Oct. 31. He said EU lawmakers will only start their work once the U.K. Parliament has passed the deal.

The deal agreed Thursday will be legally binding if approved — but it doesn't cover the all nitty gritty of future relations between the U.K. and the EU. It merely lays out the terms for withdrawal, while leaving the details of trade and other issues to future negotiations. The only issues that leaders felt they couldn't put off and had to hammer out ahead of a U.K. exit were the thorniest ones: how to address the Irish land border and the rights of British and EU citizens living in each other's territories.

The deal gives the two sides a grace period to work out other details by keeping relations as they are until the end of December 2020.

The key hurdle was finding a way to keep goods and people flowing freely across the Irish border after Brexit. That invisible, open border has underpinned the region's peace accord and allowed the economies of both Ireland and Northern Ireland to grow.

Johnson insists that all of the U.K. — including Northern Ireland — must leave the bloc's customs union, which would seem to make border checks and tariffs inevitable.

Barnier said the deal "squares this circle" by leaving Northern Ireland inside the EU single market for goods — so border checks are not needed on the land border on the island of Ireland. Instead, customs checks will be carried out and tariffs levied on goods entering Northern Ireland from Britain that are destined for the EU.

That effectively means a customs border in the Irish Sea between the islands of Ireland and Great Britain — something the British government long said it would not allow and something Northern Ireland's Democratic Unionist Party vehemently opposes.

"We have come to the conclusion — sadly come to the conclusion — that we won't be able to support the prime minister's deal," said DUP leader Arlene Foster.

———

Follow AP's full coverage of Brexit and British politics at https://www.apnews.com/Brexit

———

Associated Press writers Lorne Cook and Sam Petrequin in Brussels and Mike Corder in London also contributed.