PARIS—Olga Nychyporenko and her two children lived for five days in a basement in Bucha, a town on the front lines of Russia’s invasion of Ukraine, as bombs and tanks destroyed the streets above her.

A week later, the 48-year-old schoolteacher and her family were at a refugee center in Paris, exhausted but safe, and awaiting temporary housing. They escaped during a lull in the fighting, traveled for days to Poland and then caught a free flight to the French capital. She is now eligible to live and work in France for at least a year, with free medical care and schooling for her children.

“Poland is overflowing,” Ms. Nychyporenko said. “Now we are here, but then we’ll see. I have nowhere to go back to.”

Olga Nychyporenko, a teacher who fled Bucha, Ukraine, in Paris with her husband and one of her two children.

European Union governments have pledged unprecedented support for the more than 3.5 million refugees who have fled Ukraine, the largest movement of people on the continent since World War II. The deployment of those resources, however, is testing the EU’s capacity to cooperate on a continentwide humanitarian response. The goal is to prevent the influx of people from overwhelming the bloc’s countries in the East that find themselves on the front lines of Europe’s conflict with Russia.

Pressure is building, with the war in Ukraine in its fourth week. Refugees who fled early in the invasion were often those who had family or friends in the EU who would help support them. Those now arriving are more likely to be fleeing conflict areas in Ukraine, dealing with more trauma and lacking connections in Europe, officials and refugee organizations said. That means they will lean more on government support.

Helping the Eastern European countries deal with the influx is shaping up to be a fundamental test for the EU, said Thomas Graham, senior lecturer on Russian and European Studies at Yale University. “They have to handle this properly in the interest of their own future as a socioeconomic and political bloc.”

The EU has given Ukrainians the right to live and work anywhere in the 27-nation bloc for at least a year, under a law that was passed two decades ago during the Balkan wars but had never before been activated. The bloc is moving to set aside tens of billions of dollars from its budget for member states to house the refugees, provide medical care, pay for their children to go to school and provide other support.

Ukrainian refugees arrive at Paris’s East station from Germany, in mid-March.

Ukrainian refugees were greeted by aid workers in Paris.

Airline, train and bus companies are giving free tickets for Ukrainians to settle around the bloc, away from Poland, Romania, Hungary and Slovakia, the countries bordering Ukraine where millions of refugees are now staying. The EU has set up a system to transfer up to 10,000 people who need medical care away from refugee centers in the East. Tens of thousands of Ukrainians are arriving every day in Western Europe.

Still, of the 2.1 million refugees who have entered Poland, most remain there. European officials are discussing how to ensure that those who want to travel West can safely make the trip, to achieve a more equitable distribution of refugees across the EU. German Foreign Minister Annalena Baerbock

called on Monday for governments to fly refugees from the bloc’s borders near Ukraine for resettlement across the EU and even in the U.S.

“We not only need local corridors out of Ukraine, we need an airlift,” Ms. Baerbock said. “Everyone has to take in refugees and it’s not about a few thousand, it’s about millions.”

Poland’s welcome of Ukrainians is becoming increasingly challenging, said Agnieszka Kosowicz, president of the Polish Migration Forum, a nonprofit group. Many of the refugees are living with families who have taken them in, but Ms. Kosowicz said such arrangements aren’t a sustainable solution.

Poland’s healthcare system, already under strain from the Covid-19 pandemic, is ill-equipped to care for at least hundreds of thousands of Ukrainians who might stay in the country, refugee advocates said. The Polish government is asking the EU to cover the cost of treating Ukrainian refugees and to accept transfers of Ukrainian patients.

Western European governments should also do more to supervise the westward migration of Ukrainians by reaching out to refugees in Poland, Ms. Kosowicz said.

“It would be safer and better monitored,” she said. “It would also make perfect sense to profile people in terms of language. If you have a French speaker, it would make sense to send them to France rather than Germany.”

Diana Vitrychenko, a veterinarian who worked in a clinic in Odessa, drove five days across Europe with her son and mother to reach France, fleeing Russian forces amid fears of an attack on her hometown. Ms. Vitrychenko, who speaks French, expects to be able to work as a veterinarian in France.

Diana Vitrychenko, a veterinarian from Odessa, Ukraine, with her son at a Paris refugee center.

“I feel lost,” Ms. Vitrychenko said. “We’re getting a place to live, then look for work, French courses for those who can’t speak it. And then when all this is over, we want to return to our country.”

Europe’s stance on Ukrainian refugees is a departure from its policies on migration in recent years. During the refugee crisis of 2015, Germany initially welcomed Syrian refugees, sowing divisions with neighboring countries who didn’t want to share the burden. A plan to distribute Syrian refugees among the member states backed by Germany and France failed largely due to opposition from countries in Eastern Europe that are at the center of this crisis. Since then, the EU has worked hard to stop Syrians and people from other war-torn countries from pouring over its borders.

SHARE YOUR THOUGHTS

How will the Ukrainian diaspora change the way the European Union handles refugees? Join the conversation below.

“This crisis,” said French President Emmanuel Macron after a summit of EU leaders last month, “reminds some around the table who showed less solidarity when the migratory pressure came from other borders of Europe that it is good Europe is totally supportive and responsible together.”

The EU’s open-door policy isn’t facing resistance from the continent’s populist and nationalist politicians who for years have set the terms of debate in Europe with their opposition to immigration in any form, including refugees.

Matteo Salvini, Italy’s leading anti-immigration politician, traveled to the Polish border last week to welcome Ukrainians and was heckled for previously praising Russian President Vladimir Putin. Marine Le Pen and Eric Zemmour, nationalists who are challenging Mr. Macron in April’s presidential elections, have said they support France taking Ukrainian refugees, because they are from Europe as opposed to Syria, Afghanistan, or other conflict zones outside the continent.

“We were in a presidential campaign where stances on immigration were really strict,” said Helene Soupios-David, advocacy director for France Terre d’Asile, a nonprofit that is managing the reception center for Ukrainians in Paris. “The situation is so extraordinary that everything has flipped.”

The refugee crisis, fueled by a war on the doorstep of the EU, is far larger than in the Syrian crisis, with 3.5 million people fleeing Ukraine in under a month, compared with the 1.3 million from Syria and other countries who entered the bloc throughout 2015. The influx is already testing countries such as France and Belgium, where Ukrainians are waiting in long lines for housing and residence permits. France has opened a larger facility in the south of Paris to register refugees, along with several other centers across the country.

Anna Kazimirova and Kristina Fomitskaya, students who fled Odessa, Ukraine, sought assistance in Paris.

Anna Kazimirova, a student from the port city of Odessa on the Black Sea, crossed the border on foot to Moldova and then walked for days to reach Romania. Ms. Kazimirova studied French in school, and decided to set out for Paris. She spent the night waiting outside the refugee center to obtain one of the few hundred residency permits the center is processing each day.

“My mother wanted her daughter to study at the Sorbonne,” Ms. Kazimirova said. “Maybe dreams come true.”

Write to Matthew Dalton at Matthew.Dalton@wsj.com