European Union leaders on Friday announced a crucial migration deal reached in all-night talks after Italy's hardline new prime minister vetoed joint conclusions for the entire agenda of the summit in Brussels until his demands were met.
Giuseppe Conte, who heads a month-old anti-immigration government, said the deal meant Italy was "no longer alone" in shouldering the responsibility for migrants.
Italy has turned away a series of migrant boats in recent weeks, sparking a fresh political row three years after the bloc faced its biggest ever migration crisis.
"Today Italy is no longer alone. We are satisfied," Mr Conte, a former law professor who until recently was a virtual political unknown, told reporters following marathon talks described as "virulent".
The 28 leaders agreed to consider setting up "disembarkation platforms" outside the bloc, most likely in north Africa, in a bid to discourage migrants boarding EU-bound smuggler boats.
Member countries could set up migrant processing centres - but only on a voluntary basis - to determine whether they should be returned home as economic migrants or admitted as refugees in states willing to accept them.
French President Emmanuel Macron said that "European co-operation enabled this".
The leaders also offered a concession to German Chancellor Angela Merkel, who faces a rebellion within her coalition government, with moves to stop migrants registered in Italy and other EU countries from moving to Germany.
"After intensive discussion on what is perhaps the most challenging issue for the European union, it is a good message that we have adopted a joint text," Mrs Merkel said.
She had earlier warned that "migration could end up determining Europe's destiny" if it failed to reach an agreement.
The summit conclusions called on member countries to take "all necessary" steps to stop migrants who arrive in countries such as Italy and Greece from moving on to Germany.
After allowing more than one million asylum seekers into Germany since 2015, Mrs Merkel faces an end-of-month deadline from her interior minister to seal pacts to curb so-called secondary migration.
Italy's stance has revived political tensions in the EU, despite the fact that arrivals have dipped by 96 per cent since the peak of Europe's migration crisis in 2015, and sparked warnings that authoritarian movements will take advantage of any failure to tackle migration.
Mr Conte came to Brussels emboldened by an invitation to visit 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.
The Italian government demanded "concrete action" from other countries to help in the same way that they had after it refused to admit the migrant rescue ships Aquarius, which docked later in Spain, and Lifeline, which went to Malta.
EU President Donald Tusk 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.
But the leaders failed to agree on long-stalled plans to overhaul the bloc's asylum rules, which say that migrants must be dealt with by the first country in which they arrive.
The plans include a permanent scheme to share migrants arriving in Italy and Greece around all other EU countries.
Former communist countries in Eastern Europe, particularly the authoritarian governments of Hungary and Poland, implacably oppose the plan.
Brexit was meanwhile 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 Mrs 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.