Prague - Once slammed for refusing migrants from the Middle East and Africa, Central European countries are now welcoming unprecedented numbers of refugees from war-torn Ukraine.
During the 2015 migrant wave that brought over a million refugees into Europe, the Czech Republic, Hungary, Poland and Slovakia angered the European Union by refusing to take any in and rejecting the EU's system of migrant redistribution.
But since Russia invaded Ukraine on February 24, the ex-communist states known as the Visegrad-four group, which were under Moscow's command until 1989, have spared no effort in helping those fleeing the war.
Analysts named Ukraine's cultural, linguistic and geographic proximity among the factors behind the change in approach, alongside the fact that most refugees were women with children.
"The situation is completely different now," said sociologist Martin Buchtik, head of the Prague-based STEM polling agency.
Ukraine "is a society which is culturally very close to us, while people coming from the Middle East are very remote and we have no experience with them, unlike western countries," he told AFP.
Buchtik said the shock caused by the war was also a major factor.
"The situation occurred here and now, and there was not much room for discussion. The first phase of something shocking is not called 'the heroic phase' for nothing," he added.
More than three million Ukrainians have left their homeland via neighbouring Slovakia, Hungary, Romania, Moldova and especially Poland, which has received nearly two million refugees.
The Czech Republic, Hungary and Slovakia have each received more than 200,000 to date.
- 'Spectacular suffering' -
Bratislava-based analyst Grigorij Meseznikov suggested media coverage of the Russian invasion has also had an effect.
"The suffering of the Ukrainian people is so spectacular that it makes Slovaks sympathetic toward Ukrainian refugees," he said.
The 2015 migrant wave became a political issue in the four countries with politicians anxious not to upset voters.
But the current situation is clear-cut for the quartet that experienced oppression from their authorities or Moscow itself during the four decades of totalitarian rule following World War II.
Anna Materska-Sosnowska, a political scientist at Warsaw University, said Poland's historic aversion to Russia played a role as "the enemy of our enemy is our friend."
"Polish society reacted well, and the government was obliged to follow. Our cultural and linguistic proximity played a role," she told AFP.
"The fact that people see mainly women and children makes their compassion even greater."
In 2015, Hungary's Prime Minister Viktor Orban stood out in particular for his fierce opposition to migrants, and even had a fence built on the border with Serbia to stop the influx.
- 'Two different words' -
Having fostered close ties with Russian President Vladimir Putin, Orban said no to sending weapons to Ukraine, unlike many of his EU peers.
But he is now also in favour of receiving Ukrainian refugees, many of whom are ethnic Hungarians from the Transcarpathia region.
"Hungary will continue to help refugees but continue to reject migration," he said on Tuesday.
Orban had earlier addressed the distinction by saying: "We are not living in the comfortable West... We're living in the midst of difficulties.
"So we are able to differentiate between who is a migrant -- they are coming from the south... and who is a refugee," he added.
"It's two different words in the Hungarian language. Migrants: stop. Refugees can get all the help" they need.
A Transcarpathian family with two children has even ended up in the home of Justice Minister Judit Varga from Orban's Fidesz party.
Prague sociologist Buchtik warned however that the current stance on refugees may change if the war drags on and the arrivals do not subside.
Like the rest of Europe, the Visegrad countries are grappling with economic woes following the Covid-19 pandemic and recent spikes in energy and fuel prices.
"Of course the sentiment will change markedly. This happens in all critical situations affecting all of society," said Buchtik.
"The change in mood will depend on the demand on society. We still don't know how many will come and how many will stay."
By Jan Flemr