Theresa May is heading to Brussels this week, to ask the European Union (EU) to delay Brexit by extending Article 50 until 30 June. How does the process work?
Theresa May has said she will ask the European Union for a further delay to Brexit to break the political deadlock at Westminster.
Article 50 is part of the Lisbon Treaty that sets out what happens when a country decides that it wants to leave the EU.
As things stand, the UK is scheduled to leave the EU on 12 April.
It allows a two-year period for negotiations on a divorce - finalising a withdrawal agreement and drawing up the broad outlines of a future relationship.
The prime minister said a further extension to Article 50 was needed in order to leave the EU "in a timely and orderly way".
The Article 50 period comes to an end on 29 March, so the default position in law at the moment is that - deal or no deal - that is when Brexit will happen, whether the UK is ready or not.
She has offered to sit down with the Labour leader Jeremy Corbyn to agree a plan. She said it would have to include the current withdrawal agreement (negotiated between the UK and EU) and would focus on the future relationship with the EU.
The aim would be to put it to MPs for approval and then take it to Brussels next week. If Mrs May and Mr Corbyn couldn't agree on a single plan then a range of options could be put to MPs instead.
Article 50
This further delay requires an extension to Article 50, the part of the Lisbon Treaty which sets out what happens when a country decides that it wants to leave the EU.
It allows an initial two-year period for negotiations on a divorce - finalising a withdrawal agreement and drawing up the broad outlines of a future relationship.
Theresa May and her fellow EU leaders agreed both of those but their deal has been rejected - in successive votes - in the House of Commons.
The UK was due to leave on 29 March (two years after Article 50 was triggered) but, because no agreement could be reached at Westminster, the prime minister asked the EU for a delay to avoid the UK leaving without a deal.
Now, she says she needs more time - so how does she go about getting it?
The UK makes a request
The UK makes a request
But having failed to win two "meaningful votes" on its Brexit agreement in the House of Commons, the government is now asking for Article 50 to be extended.
The UK cannot make a decision about extending Article 50 on its own - it needs the agreement of all 27 other EU countries (EU27).
That would give the government more time to finalise a deal. Others hope an extension could produce an alternative outcome via an election or another referendum.
That's what happened when the original 29 March deadline was extended.
But the UK cannot make a decision about an extension on its own - it needs to get the agreement of all 27 other EU countries.
On that occasion, the request was made in a letter from Theresa May to the European Council, on 20 March.
Theresa May has sent a letter making a formal request for an extension, until 30 June, in time for an EU summit in Brussels when the other 27 EU leaders will have to decide whether to approve it.
The EU agreed to delay the UK's departure although not the UK's suggested date, of 30 June.
The EU27 leaders could approve the UK's request in principle and it could then be finalised even later, perhaps at ministerial or ambassadorial level, as long as that happened before 23:00 GMT on 29 March.
Instead, it offered two alternative dates:
There have been suggestions that another summit of EU leaders might have to take place next week.
Now, Theresa May has said she wants a further extension that is "as short as possible". She said the government would want a deal to be passed before 22 May to avoid the prospect of the UK having to take part in European elections.
Any extension would also need to be approved by votes in the House of Commons and the House of Lords, allowing the government to make a simple change to the law removing the reference to 29 March as exit day and replacing it with another date.
The UK will need to submit its request to EU27 leaders ahead of an emergency summit on 10 April.
The EU's decision
The EU's decision
But the EU is not obliged to say yes to the UK's request. Other EU leaders will want to know precisely why the UK is asking for an extension.
But the EU is not obliged to say yes to the UK.
If it is just to allow time for even more argument at Westminster, they will not be impressed.
One big issue is the European elections which are due to start on 23 May. The EU has said the UK cannot stay beyond 22 May if it doesn't take part in the polls.
So, the UK needs to set out exactly what it's asking for - and the EU could set some conditions of its own.
The European Parliament's legal service had argued that an extension to the end of June would be fine because the new parliament would not have held its first session by then.
This point was emphasised at a news conference in Brussels by the EU's chief negotiator, Michel Barnier.
But EU leaders have sided with a stricter legal interpretation put forward by the European Commission, which argued that allowing the UK to stay in the EU without taking part in European elections was far too much of a risk.
"What would be the purpose and the outcome of an extension?" he said. "And how can we ensure that at the end of a possible extension we are not back in the same situation as today?
A longer extension?
"Extending the uncertainty without a clear plan would add to the economic cost for our businesses but could also incur a political cost for the EU.
The EU could insist on a longer extension. But Theresa May has been firm in saying that she doesn't want one because she "shares the frustration" that many people feel about the Brexit process.
"It is for the British government and Parliament to decide very quickly what the UK wants to do next."
If the EU decided to offer the UK a delay of between nine and 12 months, or even longer, there could be a get-out clause: an understanding that the UK could leave the EU earlier than the specified date if the government managed to get an exit deal passed in Parliament.
If the government finally gets its deal through the House of Commons and a short extension is needed - to make sure any last-minute deal gets turned into law in the right way - that should get the green light.
A long extension could also buy time for either an early UK general election or even another Brexit referendum. For now, the government says it doesn't want either of those.
The European Council President Donald Tusk has said he believes that a short extension will be possible but will be "conditional on a positive vote on the withdrawal agreement in the House of Commons" next week.
Michel Barnier, the EU's chief negotiator has said a long extension carried "significant risks for the EU" and that a "strong justification would be needed" before the EU would agree.
If EU leaders were to show no flexibility at all, then they could get the blame for a no-deal Brexit.
But how long is short?
There are European elections from 23-26 May, but the new parliament does not sit for the first time until the first week of July.
The European Commission insists that the UK cannot stay in the EU beyond 23 May if it doesn't take part in the elections. But others including the European Parliament's legal service argue that an extension to the end of June would be fine because the new parliament would not have held its first session by then.
It would mean that the outgoing parliament, including its UK representatives - Members of the European Parliament (MEPs) - could be asked to sit in special session if it was needed to ratify a Brexit deal.
But if the government failed to get any deal through Parliament before the end of June, the UK would once again be looking at the prospect of leaving the EU with no deal.
And that could give the EU pause for thought.
A longer extension
The prime minister has been firm in saying that she isn't asking for a longer extension because she "shares the frustration" that many people feel about the Brexit process.
And any extension of more than three months, while certainly possible, gets into much more tricky legal and political territory.
Both the UK and the European Commission say it would mean the UK would have to take part in May's European elections. Otherwise, the UK would have no MEPs in the new European Parliament, even though it was still a member state.
Some prominent lawyers disagree about the need to take part in the elections and say a legal fix could be found - existing MEPs could be asked to stay on for a temporary period or national MPs could be appointed to ensure the UK was properly represented.
But political realities suggest that taking part in the elections will probably be a condition for a longer extension. And the UK would need to decide by 11 April whether it would legislate for holding elections in May.
So, time is still tight for decisions to be made.
If the EU decided to offer the UK a longer extension of anything between nine and 21 months, it could have a get-out clause: an understanding that it would leave the EU earlier than the specified date if the government managed to get an exit deal passed in Parliament.
But, for the moment, that is not what the prime minister is asking for.
Revoking Article 50
Revoking Article 50
It's worth pointing out that Article 50 can also be withdrawn or revoked. The UK can do that without consulting anyone else. It would mean that Brexit would not happen and the UK would remain in the EU. But Theresa May has said she does not intend to do that.
It's worth pointing out that Article 50 can also be withdrawn or revoked. The UK can do that without consulting anyone else. It would mean that Brexit would not happen and the UK would remain in the EU on the same terms it has now. But, again, Theresa May has said she does not intend to do that.
The European Court of Justice (ECJ) has ruled that a revocation should be "unequivocal and unconditional", suggesting that the ECJ would take a dim view of any attempt to withdraw an Article 50 notification and then resubmit it again later.
The European Court of Justice (ECJ) has ruled that a revocation should be "unequivocal and unconditional", suggesting that the ECJ would take a dim view of any attempt to withdraw an Article 50 notification and then resubmit it again a short time later.