Britain's Prime Minister Boris Johnson and the president of the European Commission, Jean-Claude Juncker, have hailed their new Brexit deal as a "fair and balanced agreement".
But the draft deal, which was announced just hours before a crucial summit in Brussels, now needs to be approved by both UK and European parliaments — something that could prove very difficult.
The ultimate test will be when Johnson takes the deal to the House of Commons on Saturday, where former PM Theresa May's deal was rejected three times.
"I think this deal represents a very good deal both for the EU and for the UK. It's a reasonable, fair outcome and reflects the large amount of work that's been undertaken by both sides," Johnson told reporters at a joint press conference with Junker.
"It means that we can deliver a real Brexit that achieves our objectives and it means the UK leaves whole and entire on October 31st.
"I hope very much now that my fellow MPs in Westminster, do now come together to get Brexit done, to get this excellent deal over the line and to deliver Brexit without any more delay, so we can focus on the priorities of the British people."
News of the deal broke on Thursday morning (local time) when Junker announced on Twitter "where there is a will, there is a deal — we have one!"
A tweet from Johnson quickly followed, saying a "great new deal" had been brokered.
🇪🇺🤝🇬🇧 Where there is a will, there is a #deal - we have one! It’s a fair and balanced agreement for the EU and the UK and it is testament to our commitment to find solutions. I recommend that #EUCO endorses this deal. pic.twitter.com/7AfKyCZ6k9
Junker then wrote to the president of the European Council, Donald Tusk, asking him to endorse the deal.
"As I have indicated to you in the past, I believe it is high time to complete the withdrawal process and move on, as swiftly as possible, to the negotiation on the European Union's future partnership with the United Kingdom," he said.
But all hopes of a swift agreement in Britain were promptly hammered down by Northern Ireland's Democratic Unionist Party (DUP), which said it was still opposed to the deal.
"We have been involved in ongoing discussions with the government. As things stand, we could not support what is being suggested on customs and consent issues and there is a lack of clarity on VAT," leader Arlene Foster said in a statement.
"We will continue to work with the government to try and get a sensible deal that works for Northern Ireland and protects the economic and constitutional integrity of the United Kingdom."
Without the support of the DUP's 10 politicians, Johnson may struggle to get his deal ratified.
Labour leader Jeremy Corbyn also called on MPs to reject the deal.
"From what we know, it seems the prime minister has negotiated an even worse deal than Theresa May's, which was overwhelmingly rejected," he said.
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. pic.twitter.com/ZMKSNt2Nc9
"This sell-out 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 EU's chief negotiator Michel Barnier said the deal rested on four main elements.
Firstly, Northern Ireland will remain aligned to "a limited set of EU rules" notably related to goods. "This means that all applicable procedures on goods will take place at the points of entry into Northern Ireland and not across the island," he said.
Secondly, Northern Ireland will remain in the UK's customs territory. "It will therefore benefit from the UK's future trade policy, but will also remain an entry point into our single market," he said.
Thirdly, the two sides will agree to "maintain the integrity of the single market" while also satisfying the UK's "legitimate wishes" regarding value-added tax (VAT).
And finally, Northern Ireland representatives will be able to decide whether to continue applying the EU rules after four years.
On Twitter, Johnson added the "anti-democratic backstop" had been abolished and the people of Northern Ireland would be in charge of their laws.