U.S. stocks and oil prices turned lower Thursday as investors assessed how a recent jump in commodities prices is likely to affect inflation and the Federal Reserve’s monetary policy. 

The S&P 500 ticked down 0.5% in morning trading Thursday after advancing sharply Wednesday.  The tech-focused Nasdaq Composite Index lost 1.2%, and the Dow Jones Industrial Average was down 0.2%. All three indexes opened the session higher.

Moscow’s...

U.S. stocks and oil prices turned lower Thursday as investors assessed how a recent jump in commodities prices is likely to affect inflation and the Federal Reserve’s monetary policy. 

The S&P 500 ticked down 0.5% in morning trading Thursday after advancing sharply Wednesday.  The tech-focused Nasdaq Composite Index lost 1.2%, and the Dow Jones Industrial Average was down 0.2%. All three indexes opened the session higher.

Moscow’s invasion of Ukraine has injected volatility into financial markets. Investors are trying to calculate how a shunning of Russian commodities, including oil, will feed into already elevated inflation and how aggressively central banks will raise interest rates when faced with additional price pressures and an uncertain economic outlook.

U.S. crude prices briefly surged over $116 a barrel for the first time since 2008, before reversing to trade at $110. The prospect of Iranian crude returning to the market took some steam out of the war-driven oil rally.

The decline came as representatives from the U.S., Britain, France, Germany, Russia, China and Iran engage in round-the-clock meetings in Vienna attempting restore a 2015 deal that lifted most international sanctions on Iran in exchange for tight but temporary restrictions on its nuclear program. The U.S. left the pact in 2018 and Iran has since expanded its nuclear program

If the deal were to be restored, Iranian oil exports would help make up for the Russian barrels that global buyers have shunned since it invaded neighboring Ukraine. Investors are worried that a prolonged elevation in oil prices could herald a combination of slowing growth and higher inflation—also known as stagflation.

Meanwhile, Federal Reserve Chair Jerome Powell’s testimony continued Thursday, this time before the Senate Banking Committee. Analysts say his remarks on the U.S. economy and heightened inflation in light of the latest geopolitical developments could be buoying markets.

“The inflationary impact of oil and natural gas surges is clear. Inflation is going to be stickier. Interests rates will be pushed up by central banks worried about inflation and that will be bad for growth,” said Edward Park, chief investment officer at U.K. investment firm Brooks Macdonald. “Stagflation is the big concern for 2023.”

Moscow’s invasion of Ukraine has injected volatility into broader markets.

Photo: Allie Joseph/Associated Press

European natural-gas prices edged up 1.1%, building on this week’s surge. Investors are worried that supply of natural gas could be disrupted to Europe as a result of the war. About a third of Russian gas exports to Europe flow through Ukraine, according to analysts

Shares of energy companies that are likely to benefit from higher oil prices wobbled in conjunction with prices. ConocoPhillips and Occidental Petroleum each declined about 1%. 

Snowflake shares dropped 16% after the company issued weaker-than-expected sales guidance, on pace for a record percentage drop. Best Buy gained 10%, on pace for the largest one-day percentage increase since May 2020. Okta shares fell 8.2% after the software business provided guidance that suggested aggressive investment would spur greater-than-expected near-term losses to the bottom line. Kroger added more than 10% after it reported that its sales and profit had grown.

In U.S. bond markets, the yield on the benchmark 10-year Treasury note ticked down to 1.861% from 1.862% Wednesday. Yields and prices move inversely. 

The pan-continental Stoxx Europe 600 fell 1.1%. Russian stock markets remained closed for the fourth consecutive day as the government seeks to limit a firesale, having also imposed capital controls on the ruble.

Since Russia invaded Ukraine at the end of February, the U.S. and allied countries have imposed heavy sanctions on Russia. WSJ’s Shelby Holliday dives into how these sanctions are affecting everyone from President Vladimir Putin to everyday Russian citizens. Photo: Pavel Golovkin/Associated Press

The London Stock Exchange Group has suspended trading in more than 50 Russian stocks. Index providers

MSCI Inc. and FTSE Russell have said they will cut Russian equities from their benchmarks next week and S&P Dow Jones Indices is considering doing the same. 

The ruble dropped 3.8% Thursday against the greenback to 112 rubles to the dollar, according to FactSet. Traders say investors’ and brokers’ unwillingness to touch the currency has limited the ease with which they can trade it. Currencies of nearby countries have fallen against the dollar as well, as investors worry about economic spillover. The Polish zloty fell 0.9%, and the Hungarian forint declined 0.6%.

Major stock indexes in Asia largely gained. South Korea’s Kospi jumped 1.6%, and Japan’s Nikkei 225 rose 0.7%. China’s Shanghai Composite fell 0.1%.

Write to Caitlin Ostroff at caitlin.ostroff@wsj.com