Italy - the entry point of thousands of migrants, mainly from Africa - had threatened to veto the conclusions of the group's entire agenda if it did not receive help on the issue.
Talks continued into the early hours of Friday before a compromise was reached.
Leaders said that new migrant centres could be set up in EU countries on a "voluntary" basis.
These centres would process migrants to determine which are genuine refugees and which are "irregular migrants, who will be returned", the text of their agreement says.
However, it was unclear which countries would volunteer to host the centres.