The European Union has unanimously endorsed a Brexit deal after days of intense see-saw negotiations, but it still needs to be formally approved by both European and U.K. parliaments.

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.

But with the ink barely dry on the proposal and British Prime Minister Boris 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 stood opposed, leaving the prime minister uncertain of getting the votes he needs to ratify the agreement.

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."

We’ve got a great new deal that takes back control — now Parliament should get Brexit done on Saturday so we can move on to other priorities like the cost of living, the NHS, violent crime and our environment <a href="https://twitter.com/hashtag/GetBrexitDone?src=hash&ref_src=twsrc%5Etfw">#GetBrexitDone</a> <a href="https://twitter.com/hashtag/TakeBackControl?src=hash&ref_src=twsrc%5Etfw">#TakeBackControl</a> —@BorisJohnson

Speaking minutes after the deal was adopted Thursday by European leaders, Johnson said it was time for Britain to complete its departure from the bloc and focus on a new partnership "with our EU friends."

Speaking in Brussels alongside Juncker, Johnson said the agreement was "a very good deal both for the EU and for the U.K."

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."

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 decision could happen as early as next week when the European Parliament meets in Strasbourg, France, 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 U.K. Parliament is meeting Saturday in London for the first time since 1982 to consider the deal.

Johnson, Ireland Prime Minister Leo Varadkar and German Chancellor Angela Merkel talk as they attend the European Union leaders summit dominated by Brexit. (Piroschka van de Wouw/Reuters)

The deal agreed to Thursday will be legally binding if approved — but it doesn't cover the 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.

Read the outline Brexit deal below:

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.

Johnson needs all the support he can get to push any deal past a deeply divided Parliament, and without the support of the DUP's 10 lawmakers, Johnson may struggle to get it ratified.

Lawmakers decry new proposal

Labour Party Leader Jeremy Corbyn echoed the DUP, saying the deal brokered Thursday is "even worse" than the settlement reached by Johnson's predecessor that was repeatedly rejected by lawmakers.

From what we know, Johnson's negotiated a worse deal than Theresa May. This sell-out deal risks our rights, protections and NHS. It won’t bring the country together and should be rejected. <a href="https://t.co/ZMKSNt2Nc9">pic.twitter.com/ZMKSNt2Nc9</a> —@jeremycorbyn

Corbyn said the "sellout deal won't bring the country together and should be rejected. The best way to get Brexit sorted is to give the people the final say in a public vote."

The Scottish National Party (SNP) will also not vote for Johnson's Brexit deal in Parliament because it poses a much harder exit from the EU, party leader Nicola Sturgeon said on Thursday.

"The Brexit envisaged by Boris Johnson is one which sees a much looser relationship with the EU when it comes to issues like food standards, environmental protections and workers' rights," she said.

"Scotland did not vote for Brexit in any form, and SNP MPs will not vote for Brexit in any form."

In a surprising turn of events, Brexit Party Leader Nigel Farage is urging lawmakers to reject the tentative deal, saying he would prefer an extension to the Oct. 31 Brexit deadline to be followed by a national election rather than a parliamentary vote in favour of the new terms.

Farage said Thursday the deal is "just not Brexit," which would bind U.K. to the EU in too many ways and favours a "clean break" with the bloc rather than "another European treaty."

Scotland's First Minister Nicola Sturgeon said Thursday that SNP lawmakers will not vote for Brexit in any form. (Russell Cheyne/Reuters)

Despite criticism from U.K. lawmakers, the EU's chief Brexit negotiator remains optimistic, saying the deal answers the uncertainty created by Brexit, adding that "we have delivered, and we have delivered together."