After nine hours of talks, EU leaders agreed a hard won agreement on migration.
"Disembarkation platforms", "controlled centres" and strengthening external borders are the main points of the deal reached at a Brussels summit.
To deter Mediterranean crossings, the leaders pledged to "swiftly explore" the still vague concept of "regional disembarkation platforms" outside Europe for migrants rescued from international waters.
They promised to work in cooperation with the Office of the High Commissioner for Refugees (UNHCR) and the International Organisation for Migration (IOM).
No third country has so far offered to host these reception centres, where authorities would distinguish between irregular migrants and asylum seekers admissible into the EU.
Morocco has ruled itself out and the idea has raised doubts in European capitals about its compatibility with international law.
According to the deal, migrants found and held in the EU can be moved to "controlled centres" on EU territory from where they will be able to be relocated throughout the bloc if eligible for asylum and returned to their country if they are not.
But their creation, which would be paid for with EU money, is left to the discretion of member states "on a voluntary basis" as would be the relocation of asylum seekers held there.
Italy, which welcomed the proposal, did not specify whether it would create such centres on its soil.
The term "controlled" centres was preferred over "closed" as proposed by France.
The compromise includes a paragraph for curbing the movement of migrants between EU countries.
So-called secondary movements are at the heart of tensions between German Chancellor Angela Merkel and her main government ally, the CSU, which threatened to unilaterally turn back migrants already registered elsewhere upon arrival on the German border.
"Member states should take all necessary internal legislative and administrative measures to counter such movements and closely cooperate amongst each other to this end," the conclusions said.
The agreement provides for increasing the resources of the European Border Guard Agency, Frontex, (without providing figures) and giving it a broader mandate.
It also plans to strengthen support to the Libyan Coast Guard, and in a warning to NGOs, calls on "all vessels operating in the Mediterranean" to comply with applicable laws and not obstruct Libyan coast guard operations.
In a section particularly appreciated by Malta and Italy, the 28 leaders agreed to release the second €3bn tranche of the fund to help refugees in Turkey and to contribute to the EU fund for Africa, in order to slow migration into Europe at its starting point.
The summit was supposed to unfold a compromise on this European legislation which entrusts responsibility for processing an asylum application to the country of first entry.
But the differences are still too great for amendments to be made.
"A consensus must be found on the Dublin Regulation so that it is reformed on the basis of a balance between responsibility and solidarity," the agreement said of a reform that has been bogged down for years.
The commission proposes to derogate from this principle in times of crisis, with asylum seekers being redistributed from their place of arrival.
But countries such as Hungary and Poland, supported by Austria, oppose this idea head-on.
Italy calls for a permanent system of distribution and for the principle of the responsibility of the country of arrival to be abandoned altogether.