Summit chair Donald Tusk tweeted that an extension had been agreed to but gave no details as he went to brief May on the outcome and seek her necessary agreement to the deal.
French President Emmanuel Macron arrived in combative mood, demanding Britain set out a clear path forward and dismissing reports the leaders had already chose to give May space of up to a year.
If no deal is agreed in the coming days, Britain will likely face a delay of up to a year, which would entail it holding European Parliament elections.
The EU had previously told May another extension would only be granted if the United Kingdom can present a credible alternative Brexit plan to the one which has been rejected by MPs three times.
It is understood that the majority of leaders at the Brussels summit favoured Mr Tusk's longer extension proposal, but compromised after President Macron dug his heels in.
He repeated his insistence that May must provide more guarantees that the delay would serve a useful objective, saying he wanted to hear "what is the political plan behind it".
Meanwhile, the cross-party talks seeking to break the Brexit impasse will resume tomorrow, with Labour saying the Government had not yet made a "clear shift" in its position.
Most EU leaders have indicated they could accept such an extension as long as Britain pledges not use it to play an obstructionist course and undermine EU policies.
AG William Barr testifies to House Appropriations subcommittee
Barr is scheduled to testify on the report itself at separate hearings before the Senate and House judiciary committees on May 1 and May 2.
And if the European Council did not agree on an extension at all, "there would be a risk of an accidental no-deal Brexit", he said.
The Prime Minister met with German Chancellor Angela Merkel in Berlin this afternoon for a working lunch.
Britain has already reluctantly begun preparations for the polls, setting the date for May 23, although officials insist they could still cancel it at the last minute.
The bloc would cut Britain off on June 1 if it failed to honour that condition.
"We will shape this extension in such a way that, whenever Britain has approved the Withdrawal Agreement, Britain can then complete its orderly withdrawal very shortly after", she told German MPs.
In contrast, pro-EU Justice Secretary David Gauke suggested she could carry on until she has taken the country through the current phase of the negotiations and Britain has finally left the EU.
European Union leaders spent a long dinner meeting wrangling over whether to save Britain from a precipitous and potentially calamitous Brexit this Friday, or to give the departing nation a shove over the edge.
May's ministers have begun cross-party talks with Labour on a compromise to get the withdrawal agreement through the House of Commons.
"We are prepared", he said.