EU states on Wednesday sought a deal on the final part of an overhaul for rules on how they handle asylum seekers and irregular migrants, ahead of a push to make it law by elections next year.Ambassadors from the 27 countries held talks in Brussels after Italy and Germany appeared to have ironed out a last-minute row over charities rescuing migrants stranded in the Mediterranean.Officials were hoping to get an accord on the divisive issue before EU leaders meet for two days of summits in the Spanish city of Granada Thursday. The goal of the EU is to have the long-stalled reform made law before European elections next June that will usher in a new European Parliament and commission.”Time is running out,” European Commission vice-president Margaritis Schinas told the parliament. “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 European Parliament, given the rise of right-wing parties in several EU countries, and would see Hungary and Poland take turns holding the rotating EU presidency. Once implemented, the new Pact on Migration and Asylum would seek to relieve the pressure on so-called frontline countries such as Italy and Greece by relocating some arrivals to other EU states. Those countries opposed to hosting asylum-seekers — Poland and Hungary among them — 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.The EU states and parliament will have to hammer out the final legislation in protracted rounds of negotiations. Paralysis on the issue had caused growing frustration in the bloc as it faces a rise in irregular migration. The recent arrival of thousands of asylum-seekers arriving from Africa on the Italian island of Lampedusa notably spurred urgency to get the revised policy in place.Part of the aim of the revised policy is for European Union 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 needs a weighted majority of countries, meaning those opposed, such as Poland, Hungary, Austria and the Czech Republic, do not have enough support to block it.Warsaw and Budapest have been outspoken in their criticism of the push to get them to accept or pay up for migrants. Poland’s right-wing governing party has made immigration a major part of fiercely contested elections this month and has staged a referendum on the issue for the same day.