After a marathon session in Brussels, European leaders claim to have struck a deal on how to handle refugees and irregular migrants. Here is a look at what was agreed, and whether it will be enough to end the bloc’s political crisis over migration and save Angela Merkel’s fragile coalition government in Germany.

What happened and why was it important?

EU27 leaders emerged at 4.35am on Friday from nearly nine hours of talks to announce they had reached an agreement on migration. Although the number of migrants arriving in Europe has fallen by 90% since their 2015 peak, the fallout has fuelled a political crisis between and within EU capitals. The new populist government in Italy – where most migrants land if they make it across the Mediterranean – was demanding that the rest of the bloc take “concrete steps” to share its burden (and was prepared to veto any deal if they did not), and anti-immigration leaders in countries such as Hungary and the Czech Republic were rejecting even the idea of automatic quotas. In Germany, which took in more than a million migrants in 2015, Merkel’s conservative coalition partner had threatened to shut the border to migrants who had applied for asylum elsewhere in the EU, a move that could trigger the collapse of her government and mark the end of the EU’s totemic passport-free Schengen zone. The German chancellor had said migration could “decide the fate of the EU”.

What was agreed?

Like many EU deals, this was a carefully but vaguely worded fudge to satisfy divergent views. It stopped well short of decisively solving the problem, but may have raised enough of a platform to build on. Satisfying Italy, member states agreed to send rescued migrants on EU territory to “control centres” across the bloc – at locations still to be decided, and only in countries that volunteered to have them. There, “rapid and secure processing” would sift economic migrants from refugees with a potential right to asylum, “for whom the principle of solidarity would apply”. Appeasing some of the central Europeans, no relocation measures would be compulsory. Leaders also backed plans, broadly agreed by all members, to tighten the EU’s external border, give more money to countries such as Turkey and Morocco to help prevent migrants leaving for Europe, and set up processing centres in countries such as Algeria, Egypt, Libya, Morocco, Niger and Tunisia. And in an apparent lifeline for Merkel, the accord said governments should “take all necessary internal legislative and administrative measures” to stop refugees and migrants crossing Europe’s internal borders.

Will it be enough?

Italy sounded happy, with its prime minister, Giuseppe Conte, saying the country was “no longer alone”. Merkel said the deal was “a good signal” but much still needed to be done, and France’s Emmanuel Macron said it was an important step which had delivered a “European solution and cooperation”. Perhaps more importantly, a senior politician from Merkel’s rebellious coalition partner, the Christian Social Union, said “something has moved in the right direction”; and Matteo Salvini, Italy’s pugnacious, anti-immigration interior minister, said “real progress” had been made. The deal, and whatever actions eventually follow, is not enough to heal Europe’s deep political divides over migration – but for the time being, at least, it may be enough to paper over the cracks.