The UK is heading for a Halloween Brexit after leaders of the remaining 27 EU countries offered Theresa May to delay the deadline for withdrawal to October 31.

The date 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.

The Prime Minister’s agreement is required for any change to the Brexit date to be finalised.

Most of the leaders at the Brussels summit are understood to have favoured the longer extension of as much as a year recommended by European Council President Donald Tusk.

Theresa May and German Chancellor Angela Merkel share a smile
Theresa May and German Chancellor Angela Merkel share a smile as the European Council summit gets under way (Olivier Hoslet, Pool Photo via AP)

But Mr Macron dug his heels in for a shorter delay, warning that a no-deal Brexit would be less damaging than a disruptive UK remaining for month after month.

Maltese Prime Minister Joseph Muscat welcomed the compromise date, 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 the European Council to take stock of the situation.”

It is understood the June review will assess UK co-operation during and after May’s European elections, with the possibility of the exit date being brought forward to the PM’s preferred date of June 30.

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.

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 for her agreement to be sought.

Failure to reach unanimous agreement would mean the UK crashing out of the EU without a deal at 11pm on Friday.

Mr Tusk tweeted: “EU27 has agreed an extension of Article 50. I will now meet PM Theresa May for the UK Government’s agreement.”

An 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 intends to stand by her promise to the party’s backbench 1922 Committee to stand down once the first phase of Brexit negotiations are complete.

The proposed 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.”