BRUSSELS — European Union leaders ended a summit Friday deeply divided over how to get thousands of stranded immigrants out of Italy and Greece, with an eastern bloc of nations boasting it was resisting pleas to take in refugees in a “battle” with other EU member states.

European Council leader Donald Tusk put migration at the top of the summit’s second-day agenda by circulating a note in advance that described the EU’s scheme for relocating refugees as ineffective and “highly divisive.”

The assessment proved a catalyst for high emotions and debate, pitting the countries that have refused to accept asylum-seekers against those that received disproportionate shares of the desperate people who arrived in Europe starting in 2015.

The latter include Italy and Greece, where most migrants come ashore after crossing the Mediterranean Sea, as well as Germany and a few other countries that welcomed new arrivals.

Hungarian Prime Minister Viktor Orban, who had razor wire fences built to keep migrants and refugees out of his country and has been the most outspoken of the anti-migrant voices in Europe, used war to describe a debate at a summit dinner Thursday night

In a Facebook video subtitled in English and posted after midnight, a smiling Orban said: “It’s 12:40 a.m. We struggled with each other till now. It was close combat, a type of political close combat.”

He said the Poles, Hungarians, Czechs and Slovaks “did well in battle” against EU leaders wanting them to take in more refugees.

“We held on to our positions, but we could not convince our adversaries,” Orban said.

On the other side of the divide, EU Migration Commissioner Dimitris Avramopoulos, who is Greek, earlier this week called Tusk’s note “anti-European” and said it violated the European principle of solidarity.

Tusk expressed satisfaction that his note helped all sides hash out the matter. He also acknowledged that with such deep divisions, an accepted approach to relocating Syrians, Iraqis and others who are already on the continent seemed elusive.

“Mandatory quotas have remained a contentious issue, even though its temperature has decreased considerably. If only for this reason it was worth raising this topic,” Tusk said. “Will a compromise be possible? It appears very hard, but we have to try our very best.”

The Czech Republic, Hungary, Poland and Slovakia said Thursday that they planned to spend $41 million to beef up borders.