Europe migrant crisis: Gruelling EU match ends in a draw
The threat of an Italian veto on all agreement at this EU summit concentrated minds – but they were very tired minds by 04:30 local time (02:30 GMT).
The England vs Belgium football match provided an all too brief respite.
The migration deal may be enough to defuse German Chancellor Angela Merkel's quarrel with her Bavarian CSU allies, who threaten to impose new German border controls. A CSU meeting on Sunday should decide whether her ruling coalition survives.
Illegal migration is probably Europe's most divisive issue and the marathon talks reflect that difficulty.
The still rather vague wording of the deal reveals how domestic politics is skewing EU policy in this area.
The deal appears to balance measures to tackle the Mediterranean arrivals with those to tackle the "secondary" migration of asylum seekers, who register in one country and move to another.
The numbers arriving in the EU are 95% lower than at their peak in October 2015, the European Council's summit conclusions note.
That is largely due to the EU-Turkey deal reached in March 2016 and EU naval co-operation with the Libyan coastguard.
But Italy's new populist government, elected on a promise to get tougher on illegal migrants, surprised its EU partners with its threat to scupper the summit.
Italy's Prime Minister Giuseppe Conte, new to the political game, appears to have been gently mocked when he referred to his skills as a lawyer.
The Politico website reports that Swedish Prime Minister Stefan Lofven cited his experience as a welder and Bulgarian Prime Minister Boyko Borisov chipped in: "I am a firefighter."
French President Emmanuel Macron reportedly worked with Mr Conte to persuade the others to accept new "voluntary controlled centres" in EU countries, which would screen newly-arrived migrants.
But it is not yet clear which countries will volunteer to host the centres.
So Italy won an EU commitment to ease its burden. More than 600,000 migrants have come ashore in Italy since 2014. Its reception centres and those in Greece are overcrowded and generally squalid.
The word "voluntary" is stressed in a convoluted clause about these new centres. The legalistic language reflects the difficulty of getting 28 nations to agree on migration.
Italy still wants mandatory relocation of migrants across the EU, but the Visegrad Group – the Czech Republic, Slovakia, Hungary and Poland – rejects it. A voluntary arrangement gets round that obstacle.
The EU has been wrangling for years about the Dublin Regulation, under which the country where a migrant first arrives has to process his/her asylum claim.
But by establishing controlled centres in several EU countries the numbers of migrants sent back to Italy, Greece or Spain could be cut.
Italy was dissatisfied earlier that the EU was focused only on creating "disembarkation platforms" in North Africa. The "platforms" would screen migrants picked up off North Africa, and the EU still aims to establish them, to break the people-smuggling gangs' business model.
Yet much uncertainty remains, not least about sending failed asylum seekers back to their countries of origin. The migrant "return" rate is still below 40%.
Far more co-operation with African countries – and aid – will be needed to tackle the deep-rooted poverty driving so many to head for Europe.
An Oxfam statement criticised the summit deal, saying member states "continue to try to offload their responsibilities onto poorer countries outside the EU" and play "political games".
President Macron called the deal a triumph for the EU over "national solutions". It is evidence that thwarting Europe's nationalists is part and parcel of EU efforts to tackle migration.