The EU has agreed to postpone Brexit from next Friday and give UK Prime Minister Theresa May more time to get her withdrawal deal approved in Parliament.
Mrs May was forced to ask EU leaders to delay Brexit after the UK Parliament twice overwhelmingly rejected the deal she had agreed with the EU on how to withdraw from the bloc and voted against a no-deal exit.
EU leaders are among those who fear the UK leaving the bloc without a deal would lead to chaos.
Mrs May had hoped to persuade the EU to delay the 29 March Brexit date - which is set in law - to 30 June.
Instead the 27 EU leaders offered her two dates: a delay until 22 May if MPs approve her withdrawal deal in a vote next week, or a shorter delay until 12 April if they reject it.
By that time the UK must set out its next steps - either another extension or leaving without a deal.
But the EU says a further extension beyond 12 April is only possible if the UK agrees to hold European elections on 23 May.
May has said the UK will not take part in the vote.
The EU's offer means a no-deal Brexit is considerably less likely on 29 March. But it is not off the table yet and the way forward is far from clear.
MPs are expected to vote for a third time on the Brexit deal, possibly on Tuesday.
Speaker John Bercow had originally refused a third vote on the deal unless what was put forward must be substantially different to be voted on.
They also have to agree to change the 29 March date to leave the EU.
If MPs approve her deal the UK will leave under Theresa May's EU Withdrawal Agreement on 22 May, to enable Parliament to pass all the legislation needed.
But getting it approved will be a tough task for Mrs May, especially after she angered MPs on Wednesday by going on television to essentially blame them for the impasse.
She did offer a more conciliatory tone on Thursday but it remains to be seen if she will be able to convince MPs to back her agreement.
If MPs reject her deal the UK could still leave with no deal on 12 April if a way forward is not found.
Parliament could try to take control of the process and offer a new strategy.
MPs have been told that if the deal is rejected they can hold a series of "indicative" votes to see if there is a majority for any particular alternative, such as staying in the EU Customs Union.
Mrs May would then know which option had most support in Parliament. She would then have to agree to pursue a new policy for the EU to reopen talks.
The opposition Labour party could table a vote of no confidence aimed at bringing down Mrs May's government - but it would require the support of some of Mrs May's own Conservatives. It is not clear what would happen to the dates set by the EU.
Mrs May could ask Parliament to hold an early general election or, most unlikely, call another referendum. Again, it is not entirely clear what would happen in that scenario.
Article 50, the two-year treaty provision that the UK invoked to leave the bloc in 2017, could be revoked by Mrs May, delaying Brexit indefinitely. But she is strongly opposed to that.
A petition calling for the article to be revoked has reached more than three million signatures.
The BBC's political editor Laura Kuenssberg says the choices for Mrs May are running out, making her leadership difficult to maintain.
Many MPs within her own party are alarmed by the events of the past few days.
And, she says, it is likely that MPs from all parties will push for a series of votes on different versions of Brexit or another referendum, in an attempt to take control of the process.
EU leaders were reportedly unconvinced by Mr May's assurance that she could convince the UK Parliament to back her withdrawal deal.
Mrs May made her case for a delay in a 90-minute presentation to her European counterparts and then left the room and the discussions continued for eight hours.