Russia’s invasion of Ukraine could spell trouble for the U.S. economy, fueling higher gasoline prices and hampering the post-coronavirus recovery.

Thursday’s wild price gyrations for crude oil and the U.S. stock market underscored uncertainty over the conflict’s impact. Crude oil prices surged nearly 8 percent to over $100 a barrel before retreating to previous levels. And after selling off precipitously early Thursday, the three major U.S. stock indexes rebounded and ended the day higher. Still, for the second time this week, President Biden signaled the potential for war to hurt the economy and fuel inflation, pledging to work hard to protect American families and businesses from rising prices.

“I will do everything in my power to limit the pain the American people are feeling at the gas pump. This is critical to me,” he said in a televised address, adding that the United States and allied countries are ready to tap strategic petroleum reserves if necessary.

For now, there are no signs of disruptions in Russian energy exports. But concerns that they could develop — through sanctions, pipeline damage or any deliberate Russian attempt to squeeze the West — are highlighting the risks the conflict is creating far beyond Eastern Europe.

“The U.S. economy is not walled off from Russia’s invasion of Ukraine,” Mark Hamrick, senior economic analyst at Bankrate, said in a note. “Oil prices have been rising and are rising amid the growing tensions and that’s going to exacerbate already high inflation.”

Any war-related price spikes would come on top of already burdensome inflation that is running at the highest rate in 40 years, causing particular trouble for low-income consumers.

Energy prices are also critical to the health of large swaths of American industry, including airlines, trucking and the wider transportation sector.

Gasoline prices for American consumers have already shot up nearly $1 per gallon in the past year, mostly linked to returning demand as pandemic fears ease.

Anticipation of a Russian invasion of Ukraine further lifted crude oil and gasoline prices in recent weeks. U.S. motorists paid $3.53 per gallon at the beginning of this week, according to the Energy Department.

Gasoline has been a substantial driver of rising prices in the United States, accounting for about a quarter of the 6.1 percent increase in inflation during the past 12 months, according to David Wilcox, an economist at Bloomberg Economics and the Peterson Institute for International Economics.

Yet he added that some segments of the U.S. economy benefit from higher energy prices, because the United States is itself such a large oil and gas producer after a decade-long production boom.

“In this case, the benefit is more concentrated, and the harm is more diffused, because just about everyone is an energy consumer, and relatively few are involved in energy extraction, or work for a company that manufactures extraction equipment, or own shares in companies that benefit from this work,” he said.

The European economy is also facing potential volatility due to its reliance on Russian natural gas, which heats many homes and fuels many factories on the continent.

Natural gas prices on the continent surged by 33 percent Thursday to 118.50 euros per megawatt-hour (about $130). Russia supplies about a third of Europe’s natural gas through a series of pipelines.

The natural gas spike was “just on sentiment, I think; nothing happened with flows,” said Laurent Ruseckas, an energy analyst with IHS Markit.

Russia’s attack is pushing European officials to accelerate their efforts to reduce the continent’s reliance on Russian energy. An analysis last week from Barclays, the British bank, noted that Europe would struggle to quickly substitute large quantities of Russian oil and gas with alternative energy sources.

Although the Russian economy overall is relatively small, the country is the world’s third-largest producer of oil and second-biggest producer of natural gas.

“They’re not really important to the world economy except in commodities,” including oil and gas, metals and grain, said Joseph Gagnon, a senior fellow at the Peterson Institute for International Economics and a former Federal Reserve official. Energy is “one place where they really have a significant share,” he said.

Russia’s economy heavily relies on that export revenue, making the country unlikely to purposely cut its exports in the coming months to retaliate against Western economies for their sanctions, analysts said.

Any war-related damage to Russian export pipelines traveling through Ukraine could halt some supplies, however.

And some analysts have raised the possibility that Russia’s energy deliveries could inadvertently be hindered if Western payments are delayed by U.S. and European sanctions designed to cut Russian banks from the global financial system.

Biden on Thursday stressed that the sanctions packages were designed to allow energy payments to continue.