Brexit has been postponed until Halloween after EU leaders agreed an extension of Article 50 until 31 October.
The six month delay, which will be reviewed at the end of June, means the UK will take part in EU elections unless a Brexit deal is agreed by parliament before 23 May.
It was announced following six hours of tough negotiations in Brussels, with French President Emmanuel Macron making a lone stand against a broad consensus that the UK should be able to stay in the EU for up to a year more.
Theresa May could now stay on as Prime Minister for months in defiance of growing calls to quit from her own MPs, with sources saying she would only go when she has delivered a Brexit deal.
A Conservative source said Mrs May’s departure was tied to delivery of a Withdrawal Agreement, not any fixed date.
It will further enrage Brexiteers who have called on her to go after she opened the door to cross-party talks with Labour on a softer exit deal.
Last night the former Tory leader Iain Duncan Smith joined those calling publicly for Mrs May to go. And the executive of the party’s powerful backbench 1922 Committee met yesterday to discuss leadership succession.
In Brussels, European leaders were leaning towards giving the UK more time to agree a Brexit deal, with most speaking up in favour of an extension beyond the Prime Minister’s target date of 30 June, up to the end of the year or beyond.
But Mr Macron fought to force the UK out of the EU as soon as possible, warning that Brexit was a huge distraction from other priorities.
After European leaders heard from the Prime Minister, a source at the Elysée Palace said she had failed to convince them and warned the EU would “not sacrifice everything” to stop a no-deal Brexit. The source added that a disruptive UK in the EU was “not preferable to no deal”.
The EU’s chief Brexit negotiator Michel Barnier is also understood to have argued for a short Brexit delay to keep pressure on the government and MPs to pass a Brexit deal.
And the President of the European Parliament hit out at suggestions that the UK could hold EU elections on 23 May, then withdraw before MEPs take their seats.
“We can’t accept that the European election be considered like a sort of game,” Antonio Tajani said. “The Parliament doesn’t intend to be ridiculed by anyone... We want to know what will happen and how long will current transition period last.”
Under new safeguards to protect the EU’s agenda from UK interference, the other 27 members of the bloc will hold more informal meetings to discuss issues without the UK present. Other ideas proposed included removing the UK’s representative on the EU Commission, and withdrawing its veto on budget matters.
Mrs May set out her case for a short extension with a break clause if a Withdrawal Agreement is passed in a presentation behind closed doors lasting around one hour, during which she answered questions from fellow leaders.
She then left the room to allow the other 27 heads of government to discuss the UK’s future in her absence over a dinner of scallop salad, loin of cod with brown shrimps and iced macadamia nut parfait.
An apparently relaxed Prime Minister laughed and smiled with Angela Merkel as the German chancellor showed her pictures on her tablet computer depicting the pair wearing jackets of exactly the same shade of blue as they addressed their parliaments earlier in the day.
Mrs Merkel had told German MPs earlier in the day that the EU “may well” go for a longer delay, although the UK would be allowed to leave “very quickly” if Parliament approves a withdrawal deal.
But as he arrived in Brussels, Mr Macron insisted that “for me, nothing is settled, and in particular no long extension”.
Despite having face-to-face talks with the PM in Paris on Tuesday, the French President said he needed more “clarity” and was “impatient” to hear what Mrs May would say.
“We must understand today why this request? What is the political project which justifies it and what are the clear proposals?” he said.
Mr Macron later posted on twitter: “We have managed to stay united during the past 34 months. This Union is important.”
At Prime Minister’s Questions, Tory backbencher Craig Tracey said she should abandon her “diluted deal” and take Britain out on World Trade Organisation terms, while Henry Smith warned that an extension would cost the UK £1 billion a month.
Pro-EU Justice Secretary David Gauke said Mrs May could carry on as PM until she has taken the country through the current phase of the negotiations and Britain has finally left the EU.
“I don’t think we should be rushing to change our leader when there is a big task to be done,” he said.
“If we are going through that process of trying to get Parliament to support a deal to find a way of breaking this deadlock, then Theresa May continues to be the right person to lead us through that process.”