BERLIN—A standoff over the fate of thousands of migrants camped in the forests of Belarus trying to enter Poland has pushed the European Union to embrace steps its leaders once considered controversial: explicitly paying for fences at the EU’s frontiers and pushing back people who attempt to cross.

Before the migration crisis of 2015, when over a million asylum seekers poured into Europe at the height of the Syrian civil war, the EU traditionally deemed accepting refugees to be a humanitarian imperative. Now, amid growing...

BERLIN—A standoff over the fate of thousands of migrants camped in the forests of Belarus trying to enter Poland has pushed the European Union to embrace steps its leaders once considered controversial: explicitly paying for fences at the EU’s frontiers and pushing back people who attempt to cross.

Before the migration crisis of 2015, when over a million asylum seekers poured into Europe at the height of the Syrian civil war, the EU traditionally deemed accepting refugees to be a humanitarian imperative. Now, amid growing popular backlash and the rise of anti-immigration political forces, that position is shifting.

In a bloc that long held itself up as a magnet for people leaving poorer or war-torn countries, tolerance is growing for previously contentious practices such as forcing immigrants back across its borders, a tactic now deployed by Polish and other eastern European member states bordering Belarus.

Europeans now regularly see social-media videos and TV news clips of migrants escorted by the military of Belarus—a dictatorship and Russia’s closest ally—toward the Polish border, with Moscow’s bombers flying above. The situation is prompting the EU to abandon a long-held principle of not officially financing barriers along the frontiers of a union that holds freedom of movement as a core value, European officials say.

The bloc’s political leadership, the European Council—which groups the heads of government—is asking its executive branch, the European Commission, to create legal arrangements to allow the EU to finance border walls and other immediate measures in response to what they said is a hybrid attack from Belarus.

“We are going to talk about physical infrastructure and the possibility of its financing. I am talking about a physical infrastructure that could better protect the EU,” said Charles Michel, president of the Council.

Poland, Latvia and Lithuania, the three EU nations that share a border with Belarus, have requested financing for walls and fences; migrants in Belarus near Poland on Wednesday.

Photo: Belarus State Border Committee/Zuma Press

Belarus’ dictatorial ruler Alexander Lukashenko on Thursday dared Poland to seal its border and threatened to retaliate against any new EU sanctions by shutting down the transit of natural gas to Europe. He has also asked Russian President Vladimir Putin to allow Russia’s military to jointly monitor parts of Belarus’s borders.

Russia on Thursday sent two strategic bombers on patrols in Belarus’s airspace, supported by Belarussian fighter jets, Russia’s defense ministry said. The mission followed similar exercises Wednesday by Russian long-range bombers. Russian defense officials said the measures were for military security and not directed against other countries.

In the Polish capital of Warsaw, meanwhile, tens of thousands of demonstrators marched through the city center, shooting flares and pumping fists in an annual nationalist march, organized by the government, to mark Poland’s Nov. 11 independence day. A small group in the crowd burned the flag of Germany, the destination for many of the migrants camped along Poland’s east.

Legal advisors to the European Council ruled this week that the bloc is permitted to finance the construction of physical barriers along its external borders with its common budget. Poland, Latvia and Lithuania, the three EU nations that share a border with Belarus, have already requested financing for walls and fences to prevent what they say is a forced influx of irregular migrants. Lithuania alone has a nearly 700-kilometer border with Belarus.

European officials and EU diplomats said that a number of governments were still reluctant to directly fund border walls because it is politically controversial, but several noted that a majority is tilting in favor of the demands by frontier states.

A Polish military helicopter flew near the border with Belarus on Monday.

Photo: Leonid Shcheglov/BelTA/Associated Press

That marks a profound shift from a near-decade long reluctance to pay for barriers. From 2014 to this year, the EU’s €2.4 billion border-management budget, the equivalent of $2.7 billion, contained no specific line for walls or fences. While the bloc spent lavishly on systems of border towers, infrared cameras, drones and other high tech solutions to keep out migrants, physical impediments were not specifically listed. The bloc’s €6.4 billion current border-control budget was meant to uphold that distinction: If governments wanted a fence, they were expected to pay for it themselves, although frontline nations such as Bulgaria and Greece have in the past built razor-wire fences upon receiving EU funding for border management.

That policy has faced increased pressure in recent months, since Belarus began issuing tourist visas to thousands of largely Iraqi asylum seekers hoping to enter Europe.

Poland, Lithuania and Latvia have begun fencing off their borders and declared states of emergency, locally suspending ordinary democratic freedoms in border areas now swarming with soldiers.

Instead of criticizing Poland’s right-wing government, liberal, centrist and conservative European leaders have largely expressed solidarity.

Earlier

Thousands of migrants massed at the eastern border of the European Union, some cutting razor wire and attempting to climb over fences between Belarus and Poland. Polish troops were mobilized to prevent them from crossing. Photo: Leonid Shcheglov/Zuma Press The Wall Street Journal Interactive Edition

Austria’s interior minister,

Karl Nehammer, said Thursday that he supported the Polish government’s bid for EU funding to seal its border, and not doing so—and instead focusing on handling the migrants—would send an “entirely wrong signal to traffickers.”

Europe’s most prominent leaders have long sought to control immigration without pursuing blunt solutions proposed by its more right-wing governments or by the Trump administration. When Hungary first fenced its border in 2015, the Commission compared the barrier to the Berlin Wall and called for it to be torn down.

“Putting up walls and cutting oneself off will not solve the problem,” German Chancellor Angela Merkel said in 2017, during a visit to Mexico City, referencing former President Donald Trump’s proposal for a border wall.

Today, Germany’s Green Party, which campaigned for accepting more refugees, has called for an EU-funded campaign in the refugees’ home countries warning not to travel to Belarus.

Twelve EU governments said in an open letter last month that a physical barrier appeared to be effective border protection that served the EU, and advocated EU funding. The signees included the EU’s most nationalist governments, like Poland and Hungary, and more-liberal states, like Denmark, currently ruled by its Social Democrats.

Russia has sent bombers on patrols in Belarus airspace recently.

Photo: Russian Defense Ministry Press Service/Associated Press

Europe’s hardline position on immigration has evolved gradually in recent years. Within weeks of the 2015 migrant crisis, the bloc’s leaders began pursuing what became a €3 billion deal with Turkey’s strongman President Recep Tayyip Erdogan. A similar deal was inked with the West African state of Niger, a counterterrorism ally criticized for jailing opposition members, to halt migrants moving through the Sahara toward Libya and across the Mediterranean.

The EU has trained a Libyan coast guard that the U.N. High Commissioner for Human Rights accused of bringing tens of thousands of intercepted migrants into cramped cells without basic necessities like sufficient food and medical care. In September, the bloc said it had begun to engage the Taliban government in Afghanistan to discuss both human rights and controlling migration.

In March 2020, when Mr. Erdogan wanted to renegotiate the migration deal and subsequently bussed masses of refugees toward the border with Greece, Commission President Ursula von der Leyen visited Greece to express support for its efforts. The EU granted Greece €700 million to help protect its border with Turkey.

Ms. von der Leyen at the time inspected the Greek border with Turkey, lined with razor-wire, where Greek border guards had used force to push refugees back.

“I thank Greece for being our European shield in these times,” Ms. von der Leyen said.

When the Belarus crisis started in summer, Ms. von der Leyen dispatched her home affairs commissioner, Ylva Johansson, who advocated “some kind of physical barrier.”

Polish military vehicles headed toward the border with Belarus on Thursday.

Photo: Michael Kappeler/dpa/Zuma Press

Write to Drew Hinshaw at drew.hinshaw@wsj.com and Bojan Pancevski at bojan.pancevski@wsj.com