Hungary said on Monday it would not allow weapons to be transported through its territory after the European Union pledged military aid to Kyiv.

Prime Minister Viktor Orban has sought to foster close ties with Moscow but Hungary has closed ranks with the rest of the EU on tough sanctions against Russia.

"We will not allow the transfer of deadly weapons across the Hungarian territory," Foreign Minister Peter Szijjarto wrote on Facebook.

He said the decision was taken to ensure the safety of Hungarians both in their country and across the border in Ukraine. "These shipments can easily become the target of military attacks," Szijjarto said.

"Our most important task is to guarantee the safety of the country and the Hungarian people, therefore we must not get involved in the war taking place next door."

EU foreign policy chief Josep Borrell said the bloc would give 450 million euros ($500 million) for EU member states to buy arms for the beleaguered country.

The fiercely anti-migration Orban has opened the EU and NATO member's door to Ukrainians.

Nearly 85,000 people have so far crossed from Ukraine into Hungary, UNHCR said.

Several border towns such as Zahony have set up public buildings as reception centres, with ordinary people donating food and clothes, the interior ministry said.