Poland, backed by Hungary, has staged a revolt against European Union migration reforms, leading to deadlock that on Friday stretched into a second day at the bloc's summit.
The bloc's countries struck a deal early June on a long-stalled revision of the bloc's asylum rules, but Poland and Hungary fiercely oppose the plans.
The agreement aims to share the hosting of asylum seekers across EU countries, with those who refuse having to pay money to the ones that take in migrants.
Poland and Hungary were outvoted on the plans. But during the summit that began Thursday, the countries' leaders refused to back any final statement on migration.
Poland wanted leaders to include a line that decisions on such a sensitive issue are taken "by consensus", meaning unanimity, according to a text seen by AFP.
It also wants wording that migration policy "should be based on the sovereign right of member states".
The countries demanded that any conclusions have a provision that the asylum rules had the support of every single EU member state. Other EU leaders rejected this request.
Failing to reach any agreement on the first day of the summit, which dragged into the early hours of Friday, the leaders decided to discuss the subject again on the second and last day of the gathering.
"We hope that the night is a good advisor," Belgian Prime Minister Alexander De Croo said.
"We know about the irritation among Poles and Hungarians. That is allowed," Dutch Prime Minister Mark Rutte told reporters early Friday.
He insisted, however, that "this pact stands".
"A huge battle is underway at the European Council over the migration pact. Brussels is pushing for a pro-migration text, while the Polish-Hungarian duo fights and resists together," tweeted Balazs Orban, a figure close to Hungary's Prime Minister Viktor Orban but not a relative.
European diplomats suggested Poland would be more difficult to convince than Hungary.
"Hungary can let it go, it's a blow, bit of theatre. The Polish are more difficult to read," one diplomat said, on condition of anonymity.
Poland's populists in power want to hold a national referendum on the question of welcoming refugees.
Poland currently hosts more than a million Ukrainian refugees who fled Ukraine after Russia's invasion last year.
But Warsaw has long opposed any relocation of migrants -- usually from Africa, Asia and the Middle East -- who arrived in Greece or Italy.
- Ukraine 'security commitments' -
Separate from the dispute over migration, EU leaders at the summit backed the idea of giving possible "security commitments" to help Ukraine better protect itself in future.
"The European Union and Member States stand ready to contribute, together with partners, to future security commitments to Ukraine, which will help Ukraine defend itself in the long term," conclusions released early Friday said.
The EU discussion on granting the commitments was pushed by French President Emmanuel Macron, who has long called for Europe to play a more robust role on defence.
But other member states said it remained unclear what more the bloc could add, on top of military training and weaponry it is already providing for Ukraine.
The statement comes as the United States, Britain, France and Germany negotiate bilateral pledges on weapons supplies, training and support for Ukraine ahead of a summit of NATO leaders in two weeks.
Ukraine is pushing for an upcoming NATO summit in Vilnius to send a clear message it will come under the alliance's protective umbrella once Russia's war ends.
But the alliance seems unlikely to give more concrete details on granting it membership beyond a vow in 2008 that it would join NATO one day.