BRUSSELS — About 48 hours before Britain was scheduled to crash out of the European Union, its Brexit deadline was postponed until Halloween.
The extension came after a high-stakes, six-hour summit in Brussels that ended early Thursday morning.
Twenty-seven prime ministers and presidents from across the continent had gathered to debate Britain's fate over a three-course dinner in Brussels' futuristic Europa Building.
British Prime Minister Theresa May was barred from attending what was effectively her country's sentencing.
The European leaders eventually emerged to offer the prime minister an Oct. 31 extension to sort out her Brexit mess. If before that date she achieves what she has failed to do so far, persuading British lawmakers to support her deal, then the extension would be terminated early.
It is the second time May has had to go to Europe pleading for more time. Brexit was initially scheduled to happen March 29, but at the last minute was pushed back to Friday.

The major upshot of this latest extension is that it saves the U.K. from leaving the E.U. in two days' time without any deal at all. Most experts warn a "no-deal Brexit" could tank the economy, bring food shortages, and risk conflict in Northern Ireland.
However, the agreement does little to solve the fundamental problems that have seen Brexit slide deep into chaos since June 2016, when Britain voted to leave the European Union.
"Please do not waste this time," European Council President Donald Tusk, who hosted the emergency summit, said at a news conference after the marathon dinner-meeting. "During this time, the course of action will be entirely in the U.K.'s hands."
By accepting the E.U.'s extension, May performed another reversal in a leadership that's become renowned for its high-profile 180-degree turns.
She previously had said she would not accept an extension beyond June 30 because it would clash with upcoming European elections. For a country trying to leave the E.U., participating in this vote would be a major logistical, diplomatic and political headache. This extension means that situation now looks likely.
Many in Brussels are deeply troubled by the idea of the U.K. remaining as a temporary yet powerful and potentially disruptive member. In a bid to address those fears, the E.U. extension calls on the U.K. "to act in a constructive and responsible manner" and give its "sincere cooperation" to the E.U. during the delay.
There will be a "review" at the European Council meeting in June to check this spirit is being upheld.
To avoid European elections and end the extension early, May must sell her deal to her fractious Conservative Party, with several of its members already in open rebellion because Brexit has been delayed. And ultimately she has to try to find cross-party support in the House of Commons, something that has spectacularly eluded her so far.
British lawmakers have voted down her deal three times, on two of those occasions handing it the heaviest and fourth-heaviest defeats in parliamentary history.
Even May's offer to resign in a bid to appease the holdouts did not get her the numbers.
"I do not pretend the next few weeks will be easy or that there is a simple way to break the deadlock in Parliament," she told a separate briefing at 3 a.m. Thursday. "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."
She said that "nothing is more pressing or more vital."

