The queue of cars lining up to get into Hungary from Ukraine was long. Hundreds of others came on foot.

They were escaping empty cash machines, bare supermarket shelves and long waits at petrol stations on a day of fierce fighting in Ukraine after Russia's shock invasion.

"Anyone who can is fleeing," said Krisztian Szavla, one of the first refugees who arrived in Hungary Thursday from Ukraine's western region of Transcarpathia, where a large Hungarian minority lives.

"We don't want to go through what those over the mountains in the east are experiencing, waking up to sirens and the Russians bombing your city," the 28-year-old told AFP at a petrol station at Zahony, on the Hungarian side of the border.

Ukraine's Transcarpathia region is cut off from the rest of the country by the Carpathian mountain range, and is home to a patchwork of ethnic groups with the 130,000-strong Hungarian community the largest.

Hungarian police reported long queues of people waiting to enter Hungary by car and foot
Hungarian police reported long queues of people waiting to enter Hungary by car and foot AFP / ATTILA KISBENEDEK

"On the other side there are hour-long queues for petrol, the bank ATMs have emptied, and the shop shelves are clearing due to the throngs of people," said Szavla, a marketing professional who plans to stay temporarily with friends in eastern Hungary.

"I have a wife and young child, and I don't want her to grow up without a father," he said, admitting that he doesn't want to be drafted into the army.

Through Thursday Hungarian police reported long queues of cars waiting to enter Hungary at five crossings along its 140-kilometre (85-mile) long (85-mile) border with Ukraine.

According to the Hungarian MTI news agency "at least 400 or 500 people" also crossed the border on foot into Hungary Thursday.

"The situation in Ukraine is horrible, my friends and family are leaving Kyiv and other cities for the border," said Bogdan Khmenitsky, a 33-year-old Ukrainian doctor, wheeling a suitcase in the other direction back to Ukraine.

"Today we decided to cut short a trip to a medical conference in Budapest, to help out in Ukraine," he told AFP alongside two colleagues, adding that they hope to hitchhike back to Kyiv.

Some reported empty cash machines, bare supermarket shelves and long waits at petrol stations inside Ukraine
Some reported empty cash machines, bare supermarket shelves and long waits at petrol stations inside Ukraine AFP / ATTILA KISBENEDEK

Hungarian Prime Minister Viktor Orban said earlier his country was braced for an uptick in arrivals after Russia's invasion.

"We have to count on a growing number of Ukrainian citizens arriving in Hungary and presumably applying for refugee status," he said in a video message Thursday.

"We are prepared to provide for them, we will be able to quickly and efficiently step up to this challenge."

A map shown on Orban's Facebook page yesterday indicated that Budapest believes some 600,000 refugees from Ukraine could arrive in Hungary.

In neighbouring Romania, police said Thursday that some 5,300 people entered from Ukraine along its 615-kilometre (300-mile) long shared border, up from 2,400 the day before.

Several hundred, including women accompanied by children, crossed the frontier at Sighetul Marmatiei, according to television images.

"Most of them are asking about how to get to Poland or the Czech Republic," said the city's mayor, Vasile Moldovan.

According to Defence Minister Vasile Dancu, Romania plans to accommodate potential refugees in six or seven regions along the border.

"We are prepared to deal with this collateral effect" of the invasion of Ukraine, he said.