Summit chair Donald Tusk tweeted that an extension had been agreed but gave no details as he went to brief May on the outcome and seek her necessary agreement to the deal.
The late-night deal means Britain will not crash out of the bloc on Friday, and gives May more than the three months she had asked for to build a parliamentary majority behind the withdrawal treaty she negotiated with the EU last year.
But Macron’s push for a June Brexit, and strong opposition to other leaders’ preference for a much longer extension that might increase the chances of Britain changing its mind to stay in the bloc, meant the meeting ended up with the October compromise.
October 31 would correspond to the end of the five-year mandate of the present EU executive Commission.
Leaders would meet again in June, EU diplomats said, to assess the situation. Britain could have left by then if May succeeds in building a coalition for her deal with the Labour opposition, though there is no sign of agreement yet.
In order to continue as an EU member beyond June 1, May has agreed to organise British elections to the European Parliament on May 23.
It is still unclear if that vote will go ahead, and how far it might turn into a virtual second referendum on EU membership that some hope could mean Britain cancelling Brexit.
The other 27 had all but ruled out pitching Britain, and parts of the EU economy, into chaos on Friday.
But a drive by Macron to keep London on a tight leash with an extension no longer than to June saw the emergency summit bogged down in late-night wrangling, as German Chancellor Angela Merkel and others argued the merits of granting up to a year.
As talks wore on beyond midnight, with May patiently waiting elsewhere in the building for word on her nation’s fate, Macron rallied support for his concerns about a long extension.
May said on arrival that she did not want a long delay: “I want us to be able to leave the European Union in a smooth and orderly way as soon as possible,” she said.
Want to comment?
Send us an email, making it clear which story you’re commenting on and including your full name (required for publication) and phone number (only for verification purposes). Please put “Reader views” in the subject.
We’ll publish the best comments in a regular “Reader Views” post. Your comments can be brief, or we can accept up to 350 words, or thereabouts.
InDaily has changed the way we receive comments. Go here for an explanation.
Make your contribution to independent news
A donation of any size to InDaily goes directly to helping our journalists uncover the facts. South Australia needs more than one voice to guide it forward, and we’d truly appreciate your contribution. Please click below to donate to InDaily.