European leaders struggled to overcome deep divisions on migration at a tense E.U. summit that dragged on into the early morning hours of Friday, before yielding vague pledges to strengthen external borders and explore new migrant centres.
The meeting in Brussels, dominated by a nine-hour dinner, underscored how Europe's 2015 spike in immigration continues to haunt the bloc despite a sharp drop in arrivals of people fleeing conflict and economic hardship in the Middle East and Africa.
It took place in an atmosphere of political crisis, with German chancellor Angela Merkel under intense political pressure at home and a new eurosceptic Italian government threatening to torpedo any deal that did not meet its demands.
A bleary-eyed Merkel, speaking to reporters at 5am, tried to put a positive spin on the result, saying it was a good signal that leaders had been able to agree a common text on the controversial migration issue.
But she acknowledged that the bloc still had "a lot of work to do to bridge the different views".
"Italy is not alone anymore," said Italian prime minister Giuseppe Conte.
French president Emmanuel Macron said European cooperation had "won the day", Reuters reported.
In a final statement aimed at satisfying divergent views, the leaders agreed to set up joint asylum processing sites and restrict migrant moves within the bloc, but made clear that virtually all of their pledges would be carried out on a "voluntary basis" by member states.
They also agreed to tighten their external border and increase financing for Turkey, Morocco and other North African states to prevent migration to Europe.
It was unclear whether the deal would prove sufficient to appease Merkel's coalition partner, the Christian Social Union (CSU), which has threatened to shut Bavaria's border to migrants ― a move which could trigger the collapse of her three-month-old government, as well as the E.U.'s Schengen zone of free travel.
Diplomats described a tense, tortured meeting with small groups of leaders huddled together in a desperate bid to break the deadlock and avert the humiliation of heading home without having produced an agreement.
Early in the evening, Merkel and Conte set aside 45 minutes for a chat, only to break it off after 20 minutes when the Italian leader rejected the German leader's overtures, according to diplomats.
Before the dinner clash over migration started, Conte, head of a new government that includes the anti-establishment 5-Star movement and far-right League, refused to endorse a summit text on security and trade until other leaders had bowed to his demands to help Italy manage the Mediterranean arrivals.
That forced summit chairman Donald Tusk and European Commission president Jean-Claude Juncker to cancel their pre-planned news conference.
"It is so toxic. They go into the room, clash, storm out, go back again, clash again. With no end in sight," said one exasperated diplomat as dawn approached.
"It's pure politics driving this; emotions are flying as high as back in 2015," another E.U. diplomat said.
Fewer than 45,000 migrants have made it to the European Union this year according to United Nations data — a sharp drop from the tidal wave of 2015, when many thousands were entering on a daily basis.
But the political tremors are still being felt across Europe, with populist, anti-immigrant parties on the rise in many countries.
Ex-communist easterners led by Poland and Hungary are still refusing to accept a share of the new arrivals to alleviate the burden on countries like Italy and Greece.
The agreement comes in the same month migrants have been stranded at sea aboard rescue ships, as E.U. leaders argue over who should accept them.
A humanitarian rescue ship blocked at sea for nearly a week arrived in Malta to disembark 234 migrants on Wednesday.
Malta's prime minister Joseph Muscat announced earlier that the ship would be allowed to reach safe haven in Malta, after seven other countries also agreed to take in those deemed eligible for refugee status.
He also said that the ship operated by a German aid group would be immediately impounded and the crew placed under investigation for allegedly operating illegally, including violating rescue orders and operating without proper registration