The European Union (EU) has accepted the UK's request for a Brexit delay until 31 January 2020, with an option to leave sooner if a deal is approved by Parliament.
Delaying the UK's exit date requires an extension to Article 50, the part of the Lisbon Treaty that sets out what happens when a country decides it wants to leave the EU.
Article 50 allows an initial two-year period for negotiations on the terms of exiting.
It was triggered by then Prime Minister Theresa May on 29 March 2017, giving an exit date of 29 March 2019. But this date was extended twice, first to 12 April and then until 31 October, after Mrs May's deal was rejected in successive votes in the House of Commons.
Now it is being extended for a third time - so how does this process work?
The UK makes a request
The UK cannot make a decision about extending Article 50 on its own - it has to send a request to the 27 other EU countries.
All 27 have to agree in order to secure an extension.
On Saturday 19 October, Mr Johnson sent a letter, as he was compelled to by a law known as the Benn Act. The law stated he must send an extension request should he fail to get a Brexit deal through the House of Commons by the end of 19 October.
Mr Johnson also sent a second letter saying he believed that a "further extension would damage the interests of the UK and our EU partners".
Nevertheless, on 28 October the EU agreed to the extension proposed in his first letter.
The EU's decision
The EU was not obliged to say yes.
Once it received the UK's delay request, in the form of a letter, the 27 leaders consulted with each other on their decision. It was then made following a meeting of EU ambassadors in Brussels.
If EU leaders had decided to offer a longer extension they would have been likely to have met in person to set conditions of the extension.
Revoking Article 50
It's worth pointing out that Article 50 can also be revoked - effectively cancelling Brexit.
The UK can in theory do that without consulting anyone else. That would mean that Brexit would not happen and the UK would remain in the EU on the same terms it has now.
The Liberal Democrats are the only party to say that would they would revoke Article 50 without a referendum if they won a majority in a general election.
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.