Secure centres for migrants may be set up in EU states to process asylum claims under a deal reached after marathon talks at a summit in Brussels.
The controlled centres would be set up by EU states on a voluntary basis and migrants whose claims were rejected would be "returned".
Refugees could be resettled in EU states which agreed to take them.
The deal follows weeks of diplomatic wrangling over migrant rescue ships, and which country should take them in.
Coastguard officials said on Friday that around 100 people were thought to have drowned off the Libyan coast, with 14 rescued.
They were found in waters to the east of the capital, Tripoli.
Where would the centres be built?
There were no details on which countries might set up the secure centres or take in refugees, but French President Emmanuel Macron said the centres would be in countries where migrants first arrived in the EU.
"We have struck the right balance between responsibility and solidarity," he said.
The numbers illegally entering the EU have dropped 96% since their 2015 peak, the European Council says.
Italy - the entry point for thousands of migrants, mainly from Africa - had threatened to veto the summit's entire agenda if it did not receive help.
"After this European summit, Europe is more responsible and offers more solidarity," said Italian Prime Minister Giuseppe Conte. "Today Italy is no longer alone."
But German Chancellor Angela Merkel said more needed to be done to resolve disagreements.
By Adam Fleming, BBC News, Brussels
A few things stand out as wins for Italy's new prime minister. The summit's conclusions now include a statement about the need for boats that pick up migrants in the Mediterranean to respect international law.
But the big one is approval of the concept of closed, secure processing facilities for migrants arriving in the EU. Some say this will make it easier to send back people whose claims for asylum are rejected. Others are already describing them as prisons.
This paragraph is full of caveats, commas and sub-clauses - all the hallmarks of something drafted in the middle of the night.
Another striking pledge is for an ambitious partnership with Africa. That's the EU trying to balance its tough internal approach with a friendly external one, and offering incentives to North African countries to host facilities where migrants can be assessed for resettlement in Europe.
The 28 EU leaders also agreed several other measures:
strengthening external border controls, and boosting financing for Turkey and countries in North Africa
exploring the possibility of "regional disembarkation platforms", which are aimed at breaking the business model of people-smuggling gangs by processing refugees and migrants outside the EU. However getting North African countries to host such centres could be very difficult and Morocco again on Thursday rejected the idea
internal measures taken by member states to stop migrants moving within the EU, which the agreement said undermined asylum policy and the border-free Schengen travel area
more investment in Africa to help the continent achieve a "substantial socio-economic transformation" so people no longer leave for a better life
further work to reform EU asylum policy, including changes to the so-called Dublin regulation under which migrants must be considered for asylum in the first safe country where they arrive
Whose needs does the deal meet?
Mr Conte had earlier taken the rare step of blocking the conclusions of the joint communiqué until the leaders had settled the migration issue. Both Italy and Greece want other countries to share the burden.
However several Central European states have so far rejected an EU scheme to relocate 160,000 refugees from overcrowded camps in Greece and Italy.
German Chancellor Angela Merkel had said that the migration issue could be a defining moment for the EU - but she also needed the summit to avert a political crisis at home that could bring down her government.
Interior Minister Horst Seehofer, from her Bavarian coalition partner, the CSU, had given her a deadline of this weekend. He has threatened to start turning away migrants who have already registered elsewhere from the border in his home state.
Without the CSU, Mrs Merkel would lose her parliamentary majority.
Speaking to reporters after the talks, she acknowledged the EU still had "a lot of work to do to bridge the different views".
About 56,000 migrants have arrived in Europe so far this year, the International Organization for Migration says. More than a million people arrived in 2015.
This month's tensions over migrant rescue ships barred from entry to Italian ports - most recently the German charity ship Lifeline - have put the issue firmly back in the EU spotlight.