This article originally published on October 17 has been updated.
"Where there is a will, there is a deal!" Boris Johnson and Jean-Claude Juncker both took to Twitter to announce that a Brexit agreement had been struck between the EU and the UK as they gathered in Brussels for a crucial European Council summit.
Johnson was quick to call it "a new deal that takes back control" and urged the British parliament to approve it soon "so we can move on to other priorities like the cost of living, the NHS, violent crime and our environment".
However, the revised deal contained fundamental changes to arrangements concerning Northern Ireland. The Democratic Unionist Party (DUP), on whose votes the ruling Conservative Party has depended, said they would not support it.
Although a bill to implement the deal passed an early hurdle in parliament, lawmakers rejected the government's fast-track timetable. EU27 countries have since approved another Brexit delay.
How does Boris Johnson's divorce deal differ from Theresa May's?
Many elements of the legally-binding Withdrawal Agreement remain unchanged from the one Boris Johnson's predecessor, Theresa May, agreed with Brussels in November 2018 following more than eighteen months of negotiations between London and Brussels.
The main differences are to be found on issues concerning the island of Ireland.
The deal that May agreed envisaged — in the event talks on a future trade deal failed to avoid a hard border between the Republic of Ireland and Northern Ireland — the introduction of a backstop or fall-back position.
In the absence of a free trade deal or alternative solution, that would have seen the UK remain in the EU's customs union, and Northern Ireland would follow some of the bloc's single market rules.
But Johnson's wing of the Conservative Party opposed the backstop on the grounds it could keep the UK in the EU for years to come.
No north—south border, but what about the Irish Sea?
This latest deal sees Northern Ireland leave the EU's customs union, but remain partially aligned to the single market.
However, it will remain in the UK's customs territory and follow EU procedures for goods arriving into the country.
There will be no customs checks on the island of Ireland - they will be done in ports.
For goods crossing from Great Britain to Northern Ireland, that are deemed to be staying there, no EU tariff will apply.
No EU tariffs would be paid on personal goods carried by travellers across the Irish frontier and for a second category of exempted goods that can only be for immediate consumption rather than subsequent processing.
Principle of consent
The Northern Irish assembly will have to give consent after Brexit for the region's continued alignment with the EU regulatory regime.
Four years after Brexit, the assembly will have to decide by simple majority of those taking part in the vote whether to apply it. If the vote is positive, the system is extended for another four years.
If another vote then is positive with cross-community support, the system is extended by another eight years until another vote.
If consent is not granted, there is a two-year cooling off period during which sides need to find a new solution to prevent the return of a hard border on the island of Ireland.
If the regional assembly does not sit or vote, the system continues as the default position.
Unlike the "backstop" solution in the original deal, rejected by the British parliament, this system would not be replaced by a new free-trade deal between Britain and the EU.
That marks a big concession from the EU side.
You can read the revised protocol on Ireland and Northern Ireland (64 pages) here.
Money and rights
The revised deal retains the measures in the 2018 accord to settle the other two priority issues to untangle the UK’s 46-year EU membership: of the EU: the so-called "divorce bill", and citizens’ rights – those of EU nationals living in the UK, and Britons living on the continent.
It establishes a mechanism for calculating the financial settlement — money the UK owes the EU to settle its obligations. No figure is mentioned but estimates have put it above €40 billion. It includes contributions to be paid during the planned transition period — to run until the end of 2020.
The EU's Chief Brexit negotiator Michel Barnier said the transition period could be extended to last another one or two years if an agreement was reached. In such an event, more payments would be due.
On citizens’ rights, under the deal, EU nationals in the UK and Britons in the EU – plus family members – would retain residency and social security rights after Brexit. Freedom to move and live within the EU and UK would continue during the transition period. People would be allowed to stay when it ends and apply for permanent residence after five years.
However, the right for British citizens settled in an EU country to move freely after Brexit within the bloc – as they currently can – remains up in the air and subject to a possible future agreement. This concerns those who want to retain as many of the UK's existing EU benefits as possible.
Legal disputes and other matters
Provisions for these issues are also unchanged from the original withdrawal deal.
Although a joint UK-EU committee and an arbitration panel would try to resolve disputes, the UK would remain under the jurisdiction of the European Court of Justice (ECJ) during the transition. Afterwards, its rulings would no longer have direct effect in the UK but it would retain influence.
One contentious issue — that of fishing rights — is left to be dealt with on another day. The agreement says the EU and UK should do their best to strike a separate deal on access to UK waters for EU fishing boats.
A protocol on Gibraltar — the British territory on the southern tip of Spain — seeks to ensure in particular that citizens’ rights are respected. Another, on Cyprus, aims to preserve the current situation — keeping the British military base in the EU’s customs territory.
What's in the Political Declaration on future ties?
Boris Johnson also signed up to a "level playing field" with the EU over issues including state aid, competition, social and workers' rights, the environment and climate change.
However, this engagement is included in the revised Political Declaration on future EU-UK relations — which is legally non-binding — rather than the withdrawal agreement which would have the force of an international treaty. The document provides a framework which could form the basis for a future trade agreement.
In the original declaration negotiated by the previous UK government, Theresa May envisaged the UK remaining closely aligned to the EU. Boris Johnson wants to diverge and pursue a much more independent trade policy.
The new document relates to a future EU-UK economic relationship where the UK opts for a Free Trade Agreement (FTA). But in return for zero tariffs and quotas, the UK makes "robust commitments on a level playing field" to ensure "open and fair competition".
The new political declaration is causing concern among some Brexit opponents — especially given the Johnson government's avowed intention to diverge from EU rules and forge an independent trading path.