Q&A: The Irish border Brexit backstop
A key part of the Brexit negotiations was about the border that separates Northern Ireland and the Republic of Ireland.
Last month, EU leaders approved a withdrawal deal with the UK that includes an agreement on the Irish border.
Both sides committed to avoiding the return of a "hard border" - physical checks or infrastructure - after Brexit.
This is where the controversial "backstop" comes in.
Go on then, what is the backstop?
The backstop is a position of last resort, to maintain an open border on the island of Ireland in the event that the UK leaves the EU without securing an all-encompassing deal.
At present, goods and services are traded between the two jurisdictions on the island of Ireland with few restrictions.
The UK and Ireland are currently part of the EU single market and customs union, so products do not need to be inspected for customs and standards.
But, after Brexit, all that could change - the two parts of Ireland could be in different customs and regulatory regimes, which could mean products being checked at the border.
The UK government does not want this to happen. The EU has also said it does not want any hardening of the border.
However, the UK's current red lines, which include leaving the customs union and the single market, make that very difficult.
So how to guarantee that aspiration of a frictionless border?
Well, you could try to put up a safety net.
The backstop is that safety net - an arrangement that will apply to the Irish border after Brexit, if a wider deal or technological solution cannot keep it as frictionless as it is today.
An agreement on the backstop is important because the EU won't agree to a transitional period and substantive trade talks until it is in place.
What had been agreed on the backstop before last month?
The UK and the EU said a backstop is needed - they both signed up to it in December 2017.
They also agreed on what it needs to achieve - maintaining cross-border cooperation, supporting the all-island economy and protecting the Good Friday peace agreement.
But beyond that there have been major differences between the two sides.
What is the EU's position on the backstop?
The EU originally proposed a backstop that would mean Northern Ireland staying in the EU customs union, large parts of the single market and the EU VAT system.
Its chief negotiator, Michel Barnier, continually emphasised that this backstop could only apply to Northern Ireland.
And that had been a problem in the UK?
That is an understatement.
If a backstop only applied to Northern Ireland, then the customs and regulatory border would essentially be drawn down the middle of the Irish Sea.
Goods coming into Northern Ireland from elsewhere in the UK would have to be checked to make sure they met EU standards.
Any separate status for Northern Ireland from the rest of the UK is seen as potentially damaging to the union as a whole.
As such, Prime Minister Theresa May continually rejected the EU's proposal saying it would threaten the constitutional integrity of the UK.
She suggested a backstop that would see the UK, as a whole, remaining aligned with the EU customs union for a limited time after 2020.
Her proposal, published in June, contained nothing about single market regulatory issues, which are probably more important than customs in terms of maintaining a soft border.
How did the EU react to that?
With scepticism. Mr Barnier said it could not even qualify as a backstop since the issue of regulatory alignment was not addressed.
However, he did not rule out some sort of long-term customs relationship with the UK.
Taoiseach (Irish Prime Minister) Leo Varadkar said that the backstop could not have a time limit.
But then there was a breakthrough - sort of?
After months of an impasse, on 14 November 2018, Theresa May said her cabinet had backed a draft deal between UK-EU negotiators that included agreement on a backstop.
It would see Northern Ireland staying aligned to some rules of the EU single market, if another solution cannot be found by the end of the transition period in December 2020.
That means that goods coming into Northern Ireland would need to be checked to see if they meet EU standards.
It would also involve a temporary single custom territory effectively keeping the whole of the UK in the EU customs union - unless and until both the EU and UK agree that it is no longer necessary.
What did the EU say about the deal?
On 25 November, EU leaders approved the agreement at a special summit in Brussels.
European Commission President Jean-Claude Juncker said anyone in Britain who thought the bloc might offer improved terms if MPs in Westminster rejected the deal would be "disappointed".
The Taoiseach (Irish prime minister) Leo Varadkar said the deal was the "next best outcome" to the UK staying in the EU and allowed for an orderly withdrawal.
So that resolved the issue?
Not at all.
Theresa May faced a backlash from MPs at Westminster, and several of her own ministers resigned in protest at the agreement on the backstop.
The DUP, a Northern Ireland unionist party that props up Mrs May's minority government, also abstained on key budget votes in a bid to warn the government to "bin the backstop".
It has repeatedly said it would not accept any additional Northern Ireland-only checks, because it is concerned that any differences between NI and Great Britain could threaten the union.
However, it has been urged by business and agri-food groups in Northern Ireland to support the government's plan.
Brexiteers in other parties also expressed concerns about the backstop, fearing the UK would continue to follow EU rules for an indefinite time without having any say over them.
What does legal advice on the backstop say?
On 5 December 2018, the government published the full legal advice it received on the backstop, after Parliament voted to find ministers in contempt for withholding it after a binding Commons vote.
Much of what it said repeated what has been known since the draft withdrawal deal was published.
But it did state that NI alone could end up in a customs union with the EU under the terms of the backstop, and the Attorney General Geoffrey Cox said entering into it would be a "political decision".
MPs opposed to the deal said the full advice had vindicated their position.
But the prime minister again defended her plan, and said the backstop was a necessary "last resort" to protect commitments made to Northern Ireland in the Good Friday Agreement.
What happens next?
The prime minister still has to get the deal agreed by Parliament.
A vote was due to take place on Tuesday, 11 December, but Theresa May postponed it after conceding the deal faced certain defeat in the Commons.
After surviving a vote of confidence in her leadership, she will travel to Brussels for an EU summit to seek legally binding pledges on the backstop.
It is understood the EU will not renegotiate the deal but may be willing to give greater assurances on the temporary nature of the backstop.
Ultimately, if the backstop deal does not stick, then there is no withdrawal agreement and no transition period. That means a hard, possibly chaotic, Brexit.
At that point, the EU and the Irish government would have some difficult decisions to make about what happens at the border or to Irish goods going into the wider single market.