EU leaders have agreed to extend Brexit until Halloween night, despite French fears allowing the UK to stay past June will risk sabotaging the EU and could "jeopardise" the bloc's entire future.
Taoiseach Leo Varadkar and other EU leaders signed off on the "flex-tension" offer to British prime minister Theresa May after hours of talks late last night in a plan that will allow Britain to leave the EU as soon as Westminster passes a deal.
While leaders had initially sought either a December or March extension, French president Emmanuel Macron broke ranks to warn in a tense behind-closed-doors meeting Britain is failing to give "serious guarantees" it will not use the time to sabotage the EU.
The French leader dug his feet in, insisting he would veto any deal that dragged Brexit past June.
The stand-off put Mr Macron in direct confrontation with 17 leaders happy to accept an end of year date, four a November date, and four more seeking a short delay that could be further extended.
However, shortly before 1am Brussels time on Thursday morning, Mr Macron relented, allowing a compromise date to pass which will see Brexit extended out to October 31 - Halloween night - if Britain meets a series of strict conditions.
They include:
* Britain running candidates in next month's MEP elections
* firm conditions guaranteeing Britain will not try to undermine the EU during the extra time it has been offered
* and a June review of the plan to ensure the conditions are being met
The deal is based on a plan first suggested by European Council president Donald Tusk on Tuesday night, which outlined a potential December or March extension deadline to give Ms May breathing space in Westminster.
However, while most EU leaders were prepared to back this deal, Mr Macron insisted it should not be put forward, saying a no deal crash out Brexit is not the worst option and that he believes it is more risky allowing Britain to "stay inside the tent" of the EU.
EU sources were said to be furious with Mr Macron on Wednesday night, with some suggesting the real reason for his power play was to win back domestic supporters in France and to make a case for him to become the EU's de-facto hard-man when German chancellor Angela Merkel departs.
The late night behind-closed-doors talks came after Ms May gave a one hour and six minutes presentation to EU leaders on her Brexit plans.
Ms May is understood to have largely stuck to her public letter requesting an extension until June 30 and saying she does not want to run MEP election candidates.
However, sources said during a question and answers session with EU leaders, the British prime minister said she would reluctantly run candidates if she does not agree a deal with Labour leader Jeremy Corbyn by May 22 in order to prevent a June 1 crash out date.