Theresa May has been handed a humiliating Halloween Brexit nightmare with EU leaders agreeing to a 'flextension' that delays the UK’s departure until October 31 at a crunch summit tonight.
But the Prime Minister was handed a slim lifeline with the 27 adding a break clause saying the UK can leave earlier if she can convince MPs to pass a Brexit deal - but Brussels will not reopen the Withdrawal Agreement to make that easier.
The six-month extension will be accompanied by a technical review in June, dashing the hopes of the Prime Minister, who had begged them to postpone our departure only until the end of that month.
Mrs May tried to appear positive after the summit. She told reporters: 'What we have agreed tonight means that we can actually leave the European Union before the 30th of June'.
But she added that she would she would seek more talks with Jeremy Corbyn and other political figures as she gave no indication that she planned to quit.
The Prime Minister also indicated that she believed it was still possible to leave before May 23 and avoid taking part in European Elections.
Irish premier Leo Varadkar had earlier said the UK would have to leave without a deal on June 1 if it refused to take part in the May elections.
The election takes place almost three years after the referendum vote to leave and taking part will infuriate already incandescent Tory Brexiteers.
Mrs May said: 'I do not pretend the next few weeks will be easy or that there is a simple way to break the deadlock in Parliament.
'But we have a duty as politicians to find a way to fulfill the democratic decision of the Referendum, deliver Brexit and move our country forward. Nothing is more pressing or more vital.'
The Halloween date is seen as a compromise between the majority of the EU 27 leaders who wanted to delay Brexit until the end of the year or March 202, and France's Emmanuel Macron, who emerged as a vocal opponent to a long extension.
But European Council president Donald Tusk gave Theresa May a glimmer of hope that the UK could leave before October.
He told an early-hours press conference that the 'course of action is entirely in the UK's hands'.
In a message to Britain he added: 'This extension is as flexible as I expected and a little shorter than I expected.
'But it is still enough to find the best possible solution. Please don't waste this time.'
He said Britain still had all the options on Brexit available during the extension, from approving the stalled divorce deal, to changing its leave strategy to cancelling the departure altogether.
Mr Leo Varadkar tweeted: 'We’ll take stock of situation at our regular summit in June ... UK to take part in (European Elections) or must leave on June 1st without a deal.'
The flextension also raises serious question about whether Mrs May will be in office to oversee Brexit, with mutinous MPs demanding she quit as soon as possible and senior figures already maneuvring to replace her.
And Mr Tusk even hinted that if the Uk is not ready by October B
Reuters had earlier quoted a diplomatic source who said Mr Macron wants to actually offer Mrs May roughly what she wants, telling his counterparts a delay past June 30 would undermine the EU.
The source suggested the French were being 'annoying, just posturing to show how important and powerful they are'.
They added: 'He is in a bit of a schizophrenic situation - (his) domestic audience demands that he is tough on Britain for historic reasons.
On the other hand, France is among the most-hit in any no-deal Brexit. It will take hours before we pull him down from his tree.'
Sources suggested that as many as 17 of the 27 had wanted a much longer delay. But the October 31 date is a rough half-way compromise between the two.
The Maltese prime minister Joseph Muscat confirm the dates on Twitter, saying: 'A Brexit extension until 31 October is sensible since it gives time to UK to finally choose its way. The review in June will allow EU27 to take stock of the situation.'
The Prime Minister spent a little more than an hour this evening in a question and answer session at the emergency meeting before being kicked out while they decide the UK's fate over a lavish seafood dinner.
She addressed the European Council session in the Belgian capital after president Macron had warned her that he was 'impatient' and that a long Brexit delay was not guaranteed.
He appeared to wink today as he arrived in the EU's core - after being urged not to 'humiliate' the Prime Minister.
He was set to demand the UK is subjected to a number of punitive conditions with a Christmas deadline to finally quit the trade bloc, but also raised the spectre of a no-deal Brexit, possibly on Friday.
Speaking to reporters ahead of the start of the emergency meeting of national leaders he warned that 'nothing is settled', including a long delay, and he was 'impatient' to hear what Mrs May had to say.
'We must understand today why this request, what is the political project which justifies it and what are the clear proposals?' he said.
'It is 34 months since the British referendum, and the key for us is that we are able to pursue the European project in a coherent way.
'I believe deeply that we are carrying out a European rebirth, and I don't want the subject of Brexit to get in the way of that.'
The Maltese prime minister confirmed the October 31 date, saying the June review would allow the EU to 'take stock of the situation'
Donald Tusk tonight signalled that the EU27 had made a decision after deliberating for under five hours at the emergency summit in Brussels
Mrs May's performance was shorter than the one she gave at the previous Brexit summit in March, where she spoke for more than 90 minutes before EU leaders dismissed her request - which was the same as the one she made tonight.
An EU official later told Reuters that the 'sense is May is open to a longer extension as long as it can be terminated early' and her address had been 'more solid than usual, though not many specifics' in it.
She used her own arrival in Brussels this afternoon to lash MPs for refusing to pass the Brexit deal, complaining 'we should have left by now', but dodged questions about her own future.
German Chancellor Angela Merkel - whose mother Herlind Kasner passed away aged 90 just days ago - wanted a gentler, but longer extension, into 2020 - reflecting splits among the EU27.
Arriving at the EU's headquarters the PM refused to say if she would quit if Britain was forced to swallow a longer delay - but insisted her aim is still to leave the EU on May 22 if she can win over Jeremy Corbyn.
She said: 'What is important is that any extension enables us to leave at the point at which we ratify our Withdrawal Agreement. I know many people will be frustrated that the summit is taking place at all. The UK should have left by now'.
President Macron is also believed to have called for regular 'behaviour reviews' of the UK, a bonfire of its EU powers and posts and a 'Boris-proof' lock preventing a new Tory leader causing havoc within the EU if she stands down, despite warnings from Donald Tusk and Angela Merkel not to poison relations with Britain.
Before taking off for Belgium a frustrated Theresa May blasted MPs for not voting through her EU divorce deal after Tory Eurosceptic Henry Smith accusing her of throwing away £1billion-a-month in payment to Brussels if she accepted a longer Article 50 extension tonight.
Mrs May hit back: 'We could have been outside the EU by now if we'd managed to get the deal through Parliament and I'm continuing to work to deliver Brexit'.