European Union leaders have granted the UK a six-month extension to Brexit, after late-night talks in Brussels.
The new deadline - 31 October - averts the prospect of the UK having to leave the EU without a deal on Friday, as MPs are still deadlocked over a deal.
European Council President Donald Tusk said his "message to British friends" was "please do not waste this time".
Theresa May, who had wanted a shorter delay, said the UK would still aim to leave the EU as soon as possible.
The UK must now hold European elections in May, or leave on 1 June without a deal.
The prime minister will later make a statement on the Brussels summit to the House of Commons, while talks with the Labour Party, aimed at reaching consensus on how to handle Brexit, are set to continue.
Mrs May tweeted: "The choices we now face are stark and the timetable is clear. So we must now press on at pace with our efforts to reach a consensus on a deal that is in the national interest."
So far, MPs have rejected the withdrawal agreement Mrs May reached with other European leaders last year and they have voted against leaving the EU without a deal.
The EU has ruled out any renegotiation of the withdrawal agreement.
Before the summit, Mrs May had told leaders she wanted to move the UK's exit date from this Friday to 30 June, with the option of leaving earlier if Parliament ratified her agreement.