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 they would be in countries where migrants first arrived in the EU.
"We have struck the right balance between responsibility and solidarity," he said.
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."
Other leaders struck a more cautious note.
German Chancellor Angela Merkel said more needed to be done to resolve disagreements.
And European Council President Donald Tusk said it was "too early to talk about a success".
"We have managed to reach an agreement in the European Council. But this is in fact the easiest part of the task, compared to what awaits us on the ground when we start implementing it," he told a news conference.
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.
- strengthening external border controls, and boosting financing for Turkey and countries in North Africa
- exploring the possibility of "regional disembarkation platforms", 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.
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 German charity ship Lifeline - have put the issue firmly back in the EU spotlight.
The Lifeline was only allowed to dock in Malta after intense diplomacy among several EU states, who each agreed to take some of the migrants on board. Malta said Norway had now also agreed to take a share.
Medical charity Medecins Sans Frontières (MSF) branded the new EU deal inhumane.
"The only thing European states appear to have agreed on is to block people at the doorstep of Europe regardless of how vulnerable they are, or what horrors they are escaping - and to demonise non-governmental search and rescue operations," MSF's emergencies chief Karline Kleijer said.