(Bloomberg) -- European Union diplomats meeting ahead of a summit this week have reached an outline agreement on how to tackle immigration crises after Germany and Italy blocked previous efforts to clinch a deal. 

Countries facing surges in third-country citizens crossing their borders would be allowed more flexibility on how to handle the arrivals under the consensus reached in a meeting in Brussels on Wednesday. 

“Today we have achieved a huge step forward on a critical issue for the future of the EU,” acting Spanish Home Affairs Minister Fernando Grande-Marlaska Gomez said in a statement.

Migration is becoming an increasingly urgent problem for European leaders meeting in Grenada this week, with some countries taking unilateral measures to tighten controls as more people particularly from the Middle East and Africa flee violence and poverty at home to seek better lives in Europe.

Germany ordered the deployment of checkpoints on its borders with Poland and the Czech Republic last week to stem a spike in the number of foreigners crossing over. French President Emmanuel Macron has been working on a new immigration law that would open the door to economic migrants while making it easier to expel undocumented cases. 

Italy approved rules last month month to extend the time undocumented entrants can be detained to an EU maximum 18 months as a surge in the number of boats carrying people from North Africa overwhelm the island of Lampedusa, a longtime hotspot for Europe’s periodic crises. Migration remains a challenge for Greece too, particularly after more than 500 people coming from Libya drowned off the southwest coast in international waters in June when their vessel capsized.

European Commission President Ursula von der Leyen recently called the latest increase in migration a Europe-wide problem, and pledged to address it with a 10-point action plan that includes support for managing the arrival and transfer of migrants, as well as stopping smugglers by bolstering air and sea surveillance.

Wednesday’s agreement will allow member states to resume negotiations with the European Parliament on the broader pact, which aims to establish common rules for the entry of non-EU citizens. The EU is eager to push the legislation through before next year’s EU-wide parliamentary elections.

In June, home affairs ministers agreed on asylum and migration regulations that included a rule that allows to border officials to quickly assess whether applications are unfounded. The new procedure lets governments keep asylum applicants, including families, in locations at the border.

Under the new rules, in a situation of crisis or force majeure, member states may apply specific rules for asylum and the return procedures that ease the burden on national administrations. A member state that’s facing a crisis may request solidarity measures from other EU countries, including by relocating asylum seekers to other members and receiving financial contributions.

The changes have been controversial, with Oxfam International warning they “will lock away refugees, including children, at a huge cost, in prison-like centers at Europe’s edges and block their right to asylum.”

The EU has registered more than 250,000 irregular border crossings this year, and there are 600,000 outstanding asylum applications, EU Justice and Home Affairs Commissioner Ylva Johansson said.

(Updates with details of the deal throughout.)

©2023 Bloomberg L.P.