They're called crises for a reason — they hurt when they hit, the pain lingers and they are difficult to resolve.

June's European Council, with an all-night negotiation on migration, was in many ways one big exercise in crisis management.

On migration, they failed to reach an overall agreement to rewrite the Dublin regulation on asylum policies, though a Herculean effort produced series of proposals that one senior official termed "pre-Dublin solutions."

On eurozone reforms, leaders inched forward with initiatives to improve their ability to respond to asymmetrical financial shocks. Dubbed "The Mother of All Summits" because of the huge agenda, it also touched on Brexit, sanctions on Russia and the trade war ignited by U.S. President Donald Trump.

Here are four main takeaways from a summit that was ugly at times, but saw leaders find enough common ground to live to fight another day.

1. Theresa May lends a hand

As a former U.K. home secretary, May was in her element in the marathon negotiation on migration policy. You could almost have forgotten that Brexit was on the agenda too.

We will miss the U.K. for so many reasons. This is just another one of them" — Senior EU official

While the core of the eventual compromise was a proposal championed by France's Emmanuel Macron to create "controlled centers" for asylum seekers on EU territory, May intervened helpfully to describe the U.K.'s efforts at strategic communications to discourage migrants from turning to smugglers.

She made clear Britain's own interest in helping Europe manage migration and asylum and helped to negotiate important changes in the (English) language of the leaders' conclusions. When the nine-hour debate ended just before dawn, May emerged looking as exhausted — and as happy — as her EU27 colleagues.

Of course, the U.K. remains a full member of the EU until formal withdrawal on March 29, 2019, and London has a clear interest in cultivating goodwill.

"You have to give it to her," said a senior EU official. "She did in fact contribute constructively and positively to the migration debate. We will miss the U.K. for so many reasons. This is just another one of them."

2. Battle of the newbies: Giuseppe vs Pedro

Pedro Sánchez, the Socialist successor to Mariano Rajoy, spent his first EU summit as Spanish leader playing the conciliator and showing off his pro-EU credentials. Together with Macron, he helped forge the migration compromise.

Giuseppe Conte, the former lawyer who leads Italy's new populist government, played a very prominent role as the disruptor. Arriving in Brussels Thursday, he immediately blocked the Council conclusions — even uncontroversial ones — insisting Italy would agree nothing before the divisive discussion on migration.

The most striking difference between the freshmen, however, emerged during the eurozone discussion: Conte, once again, blocked the conclusions. Sánchez, as well as Luxembourg Prime Minister Xavier Bettel, didn't hide their frustration and Bettel urged his Italian colleague "to be generous,” according to an EU official.

However, some leaders believe it is easier to deal with Conte than Matteo Salvini, the real power center in the Italian government (and current interior minister). Council President Donald Tusk attempted to coach Conte in summitry, and in his final press conference Macron said: "I see a prime minister who is responsible.”

3. Kicking a €1 trillion can down the road

The biggest victim of the June summit: the EU’s next long-term budget.

While leaders like Germany's Angela Merkel have expressed a wish to get a budget deal before May, the migration row has sapped all available political bandwidth.

In early May, the Commission proposed a budget for 2021-2027, covering everything from farm subsidies and regional funds to money for border control and integration of migrants. It needs unanimous endorsement from member countries, and the European Parliament also has to sign off.

But, unusually, budget negotiations coincide with the European Parliament election in May 2019, raising the question of whether the current MEPs and Commission officials will be the ones negotiating with the member countries.

The current Commission, keen to cement its legacy and avoid Euroskeptics derailing its proposals, is pushing for a quick budget deal. But while leaders like Germany's Angela Merkel have expressed a wish to get a deal before May, the migration row has sapped all available political bandwidth.

Leaders agreed the next EU budget should include flexible instruments for fast disbursement of funds to combat illegal migration, and that migration-related funds within the budget should focus on external migration management.

But key questions — the size of the budget, how much governments will contribute now that the U.K. is leaving, and what will happen to traditional large spending programs like cohesion and agriculture — went unaddressed. Leaders made a vague pledge to consider budget proposals “as soon as possible.”

After the summit, Macron was asked by POLITICO about the prospects of an agreement on the Multiannual Financial Framework before the EU election. He replied: “We didn’t discuss about that, but when I look at all the challenges that we have — eurozone, migration, Brexit — we will do our best, but I think we know all the constraints so I don’t want to have over-expectations.”

4. Eurozone minimalism

Leaders managed — just — to make enough progress on eurozone reforms to avoid the summit looking like a slap in the face for Merkel and Macron.

The German and French leaders, who had proposed a list of modest reforms to strengthen the monetary union against future crises, only achieved one long-overdue decision: giving the fund that finances the wind-down of failed banks the backing of the European Stability Mechanism, the eurozone bailout fund.

For the rest, the two leaders found out what happens in the eurozone when the fiscally retentive north meets the spendthrift south.

The French president’s signature proposal of a eurozone budget didn’t even get a symbolic nod in the summit communiqué. It was the main bone of contention between the Franco-German duo, who struck a deal at Meseberg Castle near Berlin, and 12 governments who wrote a letter of protest two days later.

In the coming months, with a new date for talks in December, Macron will have time to reflect on his strategy of engaging exclusively with Merkel, when she now has trouble keeping her own coalition together, let alone the eurozone.