EU member states on Wednesday agreed to the final part of an overhaul for rules on how they handle asylum seekers and irregular migrants, setting up a push to make it law by elections next year. But not all are happy.
Ambassadors from the 27 countries struck the deal after Italy and Germany ironed out a last-minute row over charities rescuing migrants stranded in the Mediterranean.
The goal of the EU is to have the long-stalled reforms, summarised in the new Pact on Migration and Asylum, made law before European elections next June that will usher in a new European parliament and commission.
"Today we have achieved a huge step forward on a critical issue for the future of the EU," said Spain's interior minister Fernando Grande-Marlaska, whose country holds the EU's rotating presidency.
"With today's agreement we are now in a better position to reach an agreement on the entire asylum and migration pact with the European Parliament by the end of this semester."
'Time is running out'
European Commission vice-president Margaritis Schinas called the text the "last missing link of the package" and urged EU states and parliament to now forge ahead with the protracted negotiations to make it law.
"Time is running out," Schinas said.
"We need the pact done and dusted before Europeans go out to vote."
The next cycle in EU politics could see a political shift in the parliament, given the rise of right-wing parties in several EU countries.
Those countries opposed to hosting asylum-seekers, notably Poland and Hungary, would be required to pay the ones that do take migrants in.
At the same time, the European Union will seek to speed up processing of asylum applications so that migrants deemed inadmissible are returned to their country of origin or of transit, and maximum detention times for migrants in border centres would be lengthened from the current 12 weeks.
Hungary, Poland opposed
Paralysis on the issue had caused growing frustration in the bloc as it faces a rise in irregular migration.
Notably, the recent arrival of thousands of asylum-seekers crossing from Africa to the Italian island of Lampedusa spurred urgency to get the revised policy in place.
Part of the aim of the revised policy is for EU countries to act together should they be faced with a sudden large inflow of asylum seekers, as happened in 2015-2016 when hundreds of thousands of migrants arrived, most of them Syrians fleeing the war in their country.
Agreement among EU member states only needed a weighted majority of countries – meaning opposition from Poland and Hungary did not derail the agreement.
Both Hungary and Poland have taken in tens of thousands of refugees from Ukraine, but are more reluctant when it comes to non-Europeans.
Poland's right-wing governing party has made immigration a major part of fiercely contested elections this month and has called a referendum on the issue for the same day.
Hungary's Foreign Minister Peter Szijjarto fired off another broadside against the reforms on Wednesday.
"We call on Brussels to end this migration policy immediately," he said.
The rancour over migration is set to figure prominently at two days of summits involving EU leaders in Spanish city Granada starting on Thursday.