(Bloomberg) -- The flight of millions of Ukrainians from Russia’s invasion has raised financial costs for the countries on the European Union’s eastern border that are taking them in, but the case of Poland shows that providing shelter can also bring economic benefits.

The EU’s largest eastern economy has born the brunt of the cost by accepting more than 3 million Ukrainian refugees since Russian President Vladimir Putin launched the attack in February. With most of them -- a group largely made up of women, children and the elderly -- carrying few personal belongings, their arrivals have helped boost the sales of everything from shoes to clothes and groceries.

That has helped counterbalance other economic difficulties because of the war and will probably help Poland show better performance when it and other bigger post-communist members publish data for first quarter economic growth on Tuesday, according to Bloomberg surveys.

“Although the inflow of Ukrainian refugees to Poland will translate into considerable fiscal cost in the short run, we think that the boost to economy’s potential in the long run will more than offset it,” Mateusz Urban, a Frankfurt-based economist at Oxford Economics said in a note last week.

Central bank Governor Adam Glapinski has said that demand from Ukrainian shoppers accounted for almost half of the recent increase in consumer spending -- helping lift what has long been a key driver of the Polish economy.

“These consumers have their own funds, brought in from Ukraine,” Glapinski said on May 6. “They also receive funds from us that they spend immediately, do not save them, but immediately spend them on the most needed products.”

Read more: Demand From Ukrainian Refugees Boosts Polish Retailers’ Sales

Other countries in the region have also seen influx of refugees, although in significantly smaller numbers than Poland. 

In Romania, Ukrainians were the largest group of foreign shoppers based on card payments in March, according to the financial technology company Global Payments. They spent 4.2 million lei ($900,000) in almost 34,000 transactions during that month, mostly on products purchased in supermarkets and pharmacies. They also paid for fuel, engine oil, car items, clothes or accommodation, Global Payments data showed.

The flip side of the new consumer demand and the emergency government spending is that they’re adding to inflation pressures, which were already rampant because of the rising commodity prices and global supply-chain disruptions.

Poland’s central bank has hiked interest rates for eight straight months to quash the fastest inflation in almost a quarter century. Romanian inflation is at a two-decade high.

That has fueled demands for higher wages in countries that have suffered labor shortages -- another aspect of the economy that the influx of Ukrainians may help ease.   

Pawel Dobrowolski, chief economist at Poland’s PFR state investment fund, estimated that as many as 300,000 Ukrainians may have already found work in Poland.

That’s “not an insignificant number for an economy the size of Poland,” he told a conference in Warsaw on Monday.

©2022 Bloomberg L.P.