For decades, European industry relied on Russia to supply low-cost oil and natural gas that kept the continent's factories humming.
Now Europe's industrial energy costs are soaring in the wake of Russia's war on Ukraine, hobbling manufacturers' ability to compete in the global marketplace.
Factories are scrambling to find alternatives to Russian energy under threat that Moscow could abruptly turn off the gas spigot, bringing production to a halt.
Europe's producers of chemicals, fertilizer, steel and other energy-intensive goods have come under pressure over the last eight months as tensions with Russia climbed ahead of the February invasion.
Some producers are shutting down in the face of competition from factories in the U.S., the Middle East and other regions where energy costs are much lower than in Europe.
Natural-gas prices are now nearly three times higher in Europe than in the U.S.
"Overall, the big concern for Europe is increasing imports and falling exports," said Marco Mensink, director general of Cefic, Europe's chemical-industry trade group.
The conflict with Russia has Europe preparing to ration gas if Russian President Vladimir Putin shuts off supplies to the entire region.
Russian state-owned natural-gas company Gazprom PJSC has already cut off Bulgaria, Finland and Poland after the countries refused to accede to a Kremlin decree demanding payment for gas in rubles.
As of last year, Russia supplied about 40% of the European Union's natural gas.
Europe's high energy costs are forecast to drag on the region's industrial production and overall economic growth this year.
Economists at the European Commission, the European Union's executive arm, expect the German economy to shrink in the second quarter under pressure from high energy prices.
Germany, the region's largest economy, is also the biggest buyer of Russian natural gas.
Europe's consumers are unlikely to pick up the slack, as high energy costs are filtering through into prices across the economy, sapping their purchasing power.
The phaseout of Russian supplies risks putting European industry at a long-term competitive disadvantage unless manufacturers can deploy technologies that will sharply reduce their fossil-fuel consumption.
But many of those technologies, such as using wind and solar energy to power chemical factory furnaces or hydrogen to make steel, are years from becoming commercially viable and will require massive investments, executives say.
Manufacturers depend on natural gas both as a source of energy and a raw material in production. In Europe, natural gas usually sets the price of electricity, hitting factories with a double-whammy if gas prices increase.
Ammonia is the most sensitive product, accounting for around 70% of the gas Europe uses as a raw material. Most of that ammonia is used to make fertilizer.
Whether companies can adapt to Europe's surging energy prices depends on whether they can draw from production sites across the globe.
OCI NV, a fertilizer producer based in Amsterdam, has lowered ammonia production at its factory in the Netherlands and is instead importing the chemical from its plants in Texas, Egypt and Algeria, said chief executive Ahmed El-Hoshy.
The company is still completing the final steps of fertilizer production in the Netherlands.
Moves by energy-hungry industries to throttle production have relieved short-term pressure on Europe's natural-gas supplies, freeing up more gas for Europe to generate electricity and heat homes through the next winter, when officials expect gas supplies will be tight.
OCI usually only imports significant quantities of ammonia to Europe in winter when gas prices are highest.
"Now every month is a winter month," Mr. El-Hoshy said.
Other fertilizer manufacturers have decided to shut down factories that can't import ammonia from overseas.
CF Industries Holdings Inc., the U.K.'s largest fertilizer producer, said last week that it would permanently shut a plant that hadn't been producing ammonia since last year.
"As a high-cost producer in an intensely competitive global industry, we see considerable challenges to long-term sustainability from our current operational approach," said Brett Nightingale, managing director of the company's British subsidiary.
European steelmakers have been curtailing production since October to save money on gas and electricity. In March, soaring electricity prices in Spain led steelmakers there to lower output or shut down completely.
"This is absolutely crazy," said Miguel Ferrandis Torres, chief financial officer of Madrid-based Acerinox SA, which shut one of its production lines for three days in March.
Industries have been lobbying European authorities and governments to assure they will keep getting gas from somewhere if Russia stops shipping the fuel.
"With Mr. Putin, nobody knows what is going to happen," said Jacob Hansen, director general of Fertilizers Europe, the industry's main lobby group. "We cannot produce any fertilizer without gas. We have to insist that we come right at the top."
If Russia halts the gas flow to Germany, the country would give priority to private households as well as critical services such as hospitals, police stations and military barracks, but large industrial players could face rationing and disruptions, putting thousands of jobs at risk.
The decision of who gets gas in Europe's largest economy would fall to the Bonn-based Federal Network Agency, the country's energy regulator.
The agency, which has established a war room equipped with a diesel stockpile, showers, camp beds and food supplies, where a 65-strong crisis team is expected to work around the clock in such an emergency, would decide based on gas-usage data it is currently collecting from companies.
"We'll take a look at how specific companies can deal with it, which companies can live with gas interruptions and reductions, and which companies definitely cannot," said Klaus Muller, the president of the agency.
Mr. Muller and his team will also look at factors such as geographical distribution of the industrial players and how to transport the gas to them.
"We try to anticipate all of these factors, but that's not a good situation to be facing," he said.
Europe's chemical makers rely on natural gas to operate crackers, the large furnaces that separate oil and natural gas into constituent chemicals under immense heat and pressure.
Cefic's Mr. Mensink said the industry is researching ways to power the process with electricity but said the technology wouldn't be ready for commercial use before 2030.
Factories want to replace gas-powered electricity with electricity from renewables, but the supply of wind and solar power isn't enough to meet demand, he said.
"We are trying to get as much as we can for our production, but the reality is that Europe will have to invest and build much more," Mr. Mensink said.
European steelmakers are pledging to overhaul their factories to run on hydrogen rather than natural gas as raw material.
"Gas supplies other than from Russia will remain crucial as long as no hydrogen infrastructure at affordable costs is available," said Axel Eggert, director general of European steel lobby group Eurofer.
Georgi Kantchev contributed to this article.