The UK could remain in the EU until 31 October, after European leaders announced they had agreed to offer a six-month Brexit extension.
After a marathon six hours of talks among EU leaders, prime minister Theresa May – who had been pushing for a 30 June exit date at the latest – was offered a significantly longer delay than she had requested.
But the move, which is likely to trigger an angry backlash from Brexiteers, stops short of the year-long extension floated by European Council president Donald Tusk following a bid by French president Emmanuel Macron to rein in the delay.
The UK will also have the option of cutting short the extension at any time should the prime minister manage to persuade MPs to back a variation of her Brexit deal before the Halloween deadline.
Speaking to reporters as the new deadline was unveiled, Tusk said the outcome of the next six months was "entirely in the UK's hands".
"It can still ratify the withdrawal agreement, in which case the extension will be terminated," he said.
"It can also reconsider the whole Brexit strategy. That might lead to changes in the political declaration, but not in the withdrawal agreement.
"Until the end of this period, the UK will also have the possibility to revoke Article 50 and cancel Brexit altogether."
He added: "Let me finish with a message to our British friends: this extension is as flexible as I expected, and a little bit shorter than I expected, but it's still enough to find the best possible solution. Please do not waste this time."
May meanwhile said she still wanted to leave the EU "as soon as possible". She urged MPs to back her Brexit deal in a bid to avoid upcoming European Parliament elections, which are due to take place on 23 May and could see huge losses for the Conservatives.
She said if parliament voted for the deal "in the first three weeks of May", the UK would leave on 1 June.
This week Simon Fraser, former permanent secretary at the Foreign Office, said May had "never had a viable plan for Brexit".
Fraser said he believed civil servants had done their best to deliver Brexit in the face of “very little political clarity” about the type of deal the government was seeking. “I don’t actually think you can blame civil servants and the idea of scapegoating civil servants for this is completely wrong and unfair,” he said.
Earlier this month cabinet secretary Sir Mark Sedwill and civil service chief executive John Manzoni revealed more than 16,000 officials were working on Brexit-focused roles across departments.