The UK is heading for a Halloween Brexit after the remaining 27 EU nations offered Theresa May a further six months to ratify or rethink her withdrawal deal.
The second extension to the Brexit process - initially intended to conclude on March 29 - definitively stopped the clock on a no-deal withdrawal on Friday with less than 48 hours to go.
In an early-hours press conference, European Council president Donald Tusk did not rule out further extensions beyond October.
And he sent a message to the UK: “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.”
Addressing the press shortly before 2am, Mrs May said that she still wanted the UK to leave the EU “as soon as possible”.
If a withdrawal deal could be ratified within the first three weeks of May, the UK could still avoid participation in that month’s European Parliament elections and leave the EU in June, she said.
Acknowledging “huge frustration” among voters that the UK has not yet left the EU, she said: “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.”
Talks between the Government and Labour to find a compromise way forward will continue at official level on Thursday.
“I do not pretend the next few weeks will be easy or that there is a simple way to break the deadlock in Parliament,” said Mrs May.
“But we have a duty as politicians to find a way to fulfil the democratic decision of the referendum, deliver Brexit and move our country forward. Nothing is more pressing or more vital.”
The six-month extension was a compromise solution thrashed out in five hours of talks in Mrs May’s absence, after French President Emmanuel Macron held out against a longer extension lasting into 2020.
Under the terms of the agreement, the UK can leave at any time if the Withdrawal Agreement reached last November is ratified by the Westminster Parliament.
If the UK fails to take part in elections to the European Parliament on May 23-26, it will automatically leave without a deal on June 1.
A review of progress will take place at the scheduled June 20 European Council summit in Brussels, but Mr Tusk stressed that this would be an opportunity for “taking stock” and not for any new negotiations.
The term of the current European Commission under Jean-Claude Juncker ends on October 31.
A UK exit by that date would get round the diplomatically awkward requirement for London to appoint a new Commissioner to his successor’s team.
But asked whether a further extension might be possible, Mr Tusk replied: “Our intention is to finalise the whole process in October... but I am too old to exclude another scenario. I think still everything is possible.”
Mrs May gave a one-hour presentation setting out her case for an extension to June 30, with a break clause allowing the UK to leave as soon as her Withdrawal Agreement was ratified.
But she had to leave the EU27 to discuss the UK’s future in her absence over a dinner of scallop soup and loin of cod.
It took five hours of wrangling before she was summoned back from the residence of UK ambassador Sir Tim Barrow at almost 1am Brussels time (12am BST) for her agreement to be sought.
She consulted Attorney General Geoffrey Cox by telephone before confirming that the new deal was acceptable.
The extension to the autumn will fuel demands from angry Tory backbenchers for Mrs May to resign and hand over to a new leader.
But senior British sources indicated that the PM intended to stand by her promise to the party’s backbench 1922 Committee to stand down once the first phase of Brexit negotiations are complete.
A Halloween Brexit would mean the second phase - dealing with the future UK/EU trade and security relationship - would not get under way until late in the autumn.
Labour MP Mary Creagh, a supporter of the People’s Vote campaign for a second referendum, said: “People across the UK will be relieved at this sensible extension.
“Parliament must agree tomorrow and MPs must move swiftly to break the Brexit deadlock with a confirmatory ballot on the PM’s deal.”
Sarah Wollaston, of The Independent Group, said an October 31 extension would provide just enough time to authorise and prepare for a referendum, though Parliament would have to move “quickly and decisively” to do it.
Labour’s Jeremy Corbyn welcomed comments from Irish Taoiseach Leo Varadkar suggesting he is ready to contemplate a role for the UK in helping decide EU trade policies if it remains in a customs union after Brexit.
Mr Varadkar said it would be in the UK’s interests to remain within the European trading bloc.
And he added: “It’s also in our interest to have the UK to be in our bloc and I think we would be generous in understanding that the UK couldn’t be a silent partner and would have to have a say in decisions being made.”
A customs union arrangement with a British say on trade deals is a central plank of Labour’s plan for Brexit.
Mr Corbyn responded with a tweet: “The Irish prime minister Leo Varadkar has confirmed this evening that Labour’s alternative plan for a new customs union with a UK say on future trade deals is credible and deliverable.”