Brexit: What happens now?
The UK and EU have agreed a variable extension to Article 50 to delay Brexit. It was due to happen on 29 March.
Theresa May has twice failed to get her deal through Parliament but MPs are expected to be given another chance to approve it. If they do, Brexit will happen with a deal on 22 May.
If they don't, there will only be a very short delay - until 12 April - for Parliament to consider alternative options. If the UK then wants a longer delay it would need to take part in the European elections in May.
It's expected that MPs will vote on a "statutory instrument" to change the date of Brexit - set in UK law in the Withdrawal Act - so it is no longer 29 March. That could happen before MPs vote again on Theresa May's deal, or after.
So what are the possible outcomes now?
1. Further vote on PM's deal
There is a longstanding convention that MPs should not be asked to vote twice on the same question during a single session of Parliament.
On 18 March John Bercow, the Speaker of the House of Commons, ruled that there couldn't just be reruns of previous votes on the deal. There would either have to be changes or MPs would have to be asked to consider a different question.
However, the agreement to delay Article 50, along with the EU's formal approval of additional documents that form part of the deal, might mean he will allow another vote.
Even if he doesn't, MPs could vote to suspend the normal rule so they can have another "meaningful vote" on the prime minister's deal.
If MPs do get to vote again, and this time back the deal, legislation would be introduced to bring it into effect with Brexit happening on 22 May.
2. No deal
No deal Brexit is still the default outcome if MPs can't agree anything else.
It could still arguably happen on 29 March, at least in UK law, if MPs reject the deal and won't accept any extension. The legal situation would be unclear in this situation because of the agreement made between the UK and the EU.
More straightforwardly, MPs could allow a no-deal Brexit to happen on 12 April.
However, when MPs have voted previously they have decisively rejected this option.
3. Major renegotiation
If MPs won't back the deal and if they continue to oppose no deal, there will have to be a process for other options to be considered.
One possibility would be to negotiate a new Brexit deal.
This wouldn't be a question of carrying out minor tweaks and having a further vote.
Instead, there could be a complete renegotiation that would take some time. It would require a further delay to Brexit and the UK would have to take part in the European Parliament elections in May.
A renegotiation could lead towards one of the other styles of deal that have been suggested - perhaps something close to the so-called "Norway model" which would involve a closer relationship with the EU than the current deal proposes.
If the EU refused to re-enter negotiations, the government would have to plump for one of the other options instead.
4. Another referendum
A further possibility is to hold another referendum.
It could have the same status as the 2016 referendum, which was legally non-binding and advisory. But some MPs want to hold a binding referendum where the result would automatically take effect - like with the 2011 referendum on changing the voting system for UK general elections.
Either way, a referendum can't just happen automatically. The rules for referendums are set out in a law called the Political Parties, Elections and Referendums Act 2000.
There would have to be a new piece of legislation to make a referendum happen and to determine the rules, such as who would be allowed to vote.
It couldn't be rushed through, because there has to be time for the Electoral Commission to consider and advise on the referendum question.
The question is then defined in the legislation.
Once the legislation has been passed, the referendum couldn't happen immediately either. There would have to be a statutory "referendum period" before the vote takes place.
Experts at University College London's Constitution Unit suggest that the minimum time for all of the required steps above is about 22 weeks.
5. Call a general election
Theresa May could decide the best way out of the deadlock would be to hold an early general election.
She doesn't have the power just to call an election. But, as in 2017, she could ask MPs to vote for an early election under the terms of the Fixed Term Parliaments Act.
Two-thirds of all MPs would need to support the move. The earliest date for the election would be 25 working days later but it could be after that - the prime minister would choose the precise date.
6. Another no-confidence vote
The government survived a vote of no confidence on 16 January by 325 votes to 306. Labour could table another no confidence motion at any time.
Under the Fixed Term Parliaments Act 2011, UK general elections are only supposed to happen every five years. The next one is due in 2022.
But a vote of no confidence lets MPs vote on whether they want the government to continue. The motion must be worded: "That this House has no confidence in Her Majesty's Government."
If a majority of MPs vote for the motion then it starts a 14-day countdown.
If during that time the current government or any other alternative government cannot win a new vote of confidence, then an early general election would be called.
That election cannot happen for at least 25 working days.
7. No Brexit
The European Court of Justice has ruled that it would be legal for the UK to unilaterally revoke Article 50 to cancel Brexit (without the need for agreement from the other 27 EU countries).
With the government still committed to Brexit, it's very likely that a major event such as a further referendum or change of government would have to happen before such a move.
However, any delay to Brexit would certainly lead to questions about whether the ultimate destination was going to be a reversal of the 2016 referendum.
It's not totally clear what the process would be. But an act of Parliament calling for Article 50 to be revoked would probably be sufficient.
After Theresa May survived a challenge to her leadership, the Conservative Party's rules mean she won't face another for 12 months.
But she could always decide to resign anyway, if she can't get her deal through and she's not prepared to change course.
That would trigger a Conservative leadership campaign which would result in the appointment of a new prime minister.
She might also come under pressure to resign if MPs pass a "censure motion" - that would be a bit like a no-confidence vote but without the same automatic consequences. Again this could lead to a change in prime minister or even a change in government.
Whoever ended up in charge would still face the same basic range of Brexit options though.