By Agence France-Presse
German Chancellor Angela Merkel had warned that the bloc's "destiny" was at stake if it failed to reach an agreement, with her own job also hanging in the balance as tensions over the issue grow at home.
Italian Prime Minister Giuseppe Conte, who heads a month-old populist and anti-immigration government, had vetoed joint conclusions for the entire agenda of the summit in Brussels until his demands were met.
Italy has recently refused to let several migrant rescue boats dock at its ports, demanding that the responsibility for people arriving across the Mediterranean should be shared between other countries.
Twelve hours after talks began, EU President Donald Tusk said on Twitter that "EU28 leaders have agreed on... conclusions" including migration.
French President Emmanuel Macron said that "European cooperation enabled this".
Italy's stance has revived political tensions in the EU, despite the fact that arrivals have dipped sharply since Europe's migration crisis erupted in 2015, and sparked warnings that authoritarian movements will take advantage of any failure to tackle migration.
Former law professor Conte, until recently a virtual political unknown, came to Brussels emboldened by the announcement of an upcoming visit to US President Donald Trump, who has hailed Rome's tough stance, and who himself blocked the conclusions of a recent G7 leaders meeting on trade.
"Italy does not need more words, but concrete actions," Conte told reporters as he arrived at the summit.
The Italian government wants other countries to help in the same way that they had after it refused to admit the rescue ships Aquarius, which docked later in Spain, and Lifeline, which went to Malta.
But the lengthy talks proved difficult.
"It was a very virulent discussion and everyone jumped on the Italian," a European source said.
Merkel's political future at home is also at stake and she issued a rallying call to the other European leaders to back her stance.
"Europe has many challenges but migration could end up determining Europe's destiny," Merkel told German lawmakers hours ahead of the summit.
For years Europe's most powerful leader, Merkel risks seeing her fragile coalition collapse if she cannot reach deals with Italy and other countries to stop migrants initially arriving in those countries from moving on to Germany.
After allowing more than one million asylum seekers into Germany since 2015, Merkel faces an end-of-month deadline from her own interior minister to seal pacts to curb so-called secondary migration.
Italy has insisted on getting help for dealing with new arrivals before making any further deals.
European sources said several countries, including France, Italy and Spain, had proposed centres to process asylum seekers arriving on European shores.
Those eligible for asylum would then be sent to other European countries willing to take them.
Tusk, the summit host, meanwhile issued a fresh warning on the need for action on migration to stave off rising populism and authoritarianism, saying that "the stakes are high and time is short".
"Some may think I am too tough in my proposals on migration, but trust me, if we don't agree on them, then you'll see some really tough proposals from some really tough guys," the former Polish premier added.
World Cup surprise
Tusk has proposed that the leaders approve work on migrant "disembarkation platforms" in countries outside Europe, most likely in Africa, according to a draft summit statement.
But long-mulled plans for a permanent scheme to share migrants arriving in Italy and Greece around all other EU countries appear doomed to fail for now.
Former communist countries in Eastern Europe, particularly the authoritarian governments of Hungary and Poland, implacably oppose the plan.
Brexit has meanwhile been largely relegated to the sidelines of this summit, with British Prime Minister Theresa May set to update leaders after admitting the need to make "faster" progress as she arrived at the venue.
EU leaders are expected on Friday to say that talks, which have stalled on the issue of the Irish border, are running out of time to get a deal.
But in a light-hearted bid to ease tensions, Belgian premier Charles Michel surprised May with a gift of a Belgian football shirt.
A World Cup clash between Belgium and England coincided with the summit on Thursday night. Belgium won 1-0.