U.S. stock indexes fell and bond yields slipped Tuesday while oil prices rose to multiyear highs, as Russia’s invasion of Ukraine continued to whipsaw through markets.

Stock markets have been battered in 2022, with the S&P 500 and Nasdaq both posting their worst two-month stretches since March 2020 to start the year. The war in Ukraine has further soured investors’ sentiment: Though only 1% of S&P 500 companies’ revenue stems from Russia and Ukraine, according to FactSet, investors are still worried about ripple effects on...

U.S. stock indexes fell and bond yields slipped Tuesday while oil prices rose to multiyear highs, as Russia’s invasion of Ukraine continued to whipsaw through markets.

Stock markets have been battered in 2022, with the S&P 500 and Nasdaq both posting their worst two-month stretches since March 2020 to start the year. The war in Ukraine has further soured investors’ sentiment: Though only 1% of S&P 500 companies’ revenue stems from Russia and Ukraine, according to FactSet, investors are still worried about ripple effects on the global economy. The geopolitical crisis came as economies were already facing the highest inflation in decades, heaping pressure on central banks to raise interest rates.

“Now we have this shock, and this shock feeds into the biggest risk: sustained high inflation,” said Jon Maier, chief investment officer at Global X ETFs.

The S&P 500 fell 67.68 points, or 1.5%, to 4306.26, on Tuesday. The blue-chip Dow Jones Industrial Average lost 597.65 points, or 1.8%, to 33294.95, while the technology-heavy Nasdaq Composite was down 218.94 points, or 1.6%, to 13532.46.

Oil prices rallied, rising back above $100 a barrel to their highest level since 2014. Brent crude, the international oil benchmark, climbed $7 a barrel, or 7.1%, to $104.97. Benchmark European natural-gas prices jumped over 24%. Members of the International Energy Agency agreed Tuesday to release supplies from oil reserves in an effort to keep a lid on rising crude prices.

Energy companies’ stocks gained alongside oil prices, with Occidental Petroleum rising $3.06, or 7%, to $46.79 and Chevron adding $5.72, or 4%, to $149.72. Refiners balked at buying Russian oil, while banks are refusing to finance shipments of Russian commodities, according to oil executives, bankers and traders. Russia is the single biggest gas exporter and a major supplier of crude oil.

Safe-harbor assets were in demand, lifting gold prices and pressuring government bond yields. Gold prices rose $43 a troy ounce, or 2.3%, to $1,942.40. The yield on the benchmark 10-year U.S. Treasury note fell to 1.708% Tuesday, its fourth-lowest close this year, with investors betting that the Federal Reserve won’t act as aggressively to curb inflation. The yield on German government bonds fell into negative territory for the first time since January. Yields fall as bond prices rise.

The fall in government bond yields also dragged down bank stocks. The KBW Nasdaq Bank Index of large U.S. commercial lenders lost more than 6%. 

Stock indexes around the world have been volatile in recent days as investors attempt to gauge the potential global economic impact from the invasion and resulting sanctions. Constricted supplies of Russian commodities could add to inflation, but investors hope the overall effect on the world’s biggest economies will be muted.

“We’re in a situation that I don’t believe there is an actual playbook for,” said Eric Merlis, managing director of corporate risk solutions at Citizens.

Bitcoin prices rose 5.3% to $43,869.58 from its 5 p.m. level on Monday. The invasion of Ukraine has driven demand for cryptocurrencies, helping lift Bitcoin and other coins.

Russians are lining up to use ATMs as ordinary citizens begin to feel the impact of Western allies’ sanctions on the country following Moscow’s invasion of Ukraine. Meanwhile, the Moscow Exchange remained closed Tuesday. Photo: AP Photo/Dmitri Lovetsky

In corporate news, Target’s shares jumped $19.66, or 9.8%, to $219.43 after the retailer reported strong sales during the holiday period. Albertsons rose $2.25, or 7.7%, to $31.40 after the supermarket chain said it had begun a strategic review. Human-resources software company Workday gained $11.28, or 4.9%, to $240.33 after reporting earnings late Monday that beat estimates.

“The question from here: Is the economy able to continue to push forwards through these segments and avoid contractions?” said

Matt Stucky, senior portfolio manager at Northwestern Mutual Wealth Management Company.

Cease-fire talks have failed to produce concrete results so far. Russia and Ukraine have agreed to further talks, and investors have welcomed the fact that some have taken place. Still, Moscow is pouring manpower and equipment into the country and Russian forces have adopted a strategy of pummeling civilian areas, a bid to demoralize resistance.

“I am not sure what we will see from negotiations, but on the ground there will be no letup because [Russian President Vladimir] Putin has to come away from this war with something to show for it,” said Hani Redha, a portfolio manager at PineBridge Investments.

Traders at the New York Stock Exchange on Monday.

Photo: Allie Joseph/Nyse/Zuma Press

Russian markets have been dealt a heavy blow by the invasion and the ensuing sanctions, with investors jettisoning Russian stocks. A sharp, sudden interest-rate rise from the nation’s central bank helped send the ruble tumbling.

Tradeweb Markets Inc. , a top bond-trading platform, removed Russian securities Tuesday, citing Western sanctions.

On Tuesday, the Russian ruble retreated against the dollar, after falling almost 30% Monday. Market-data services have shown limited price updates this week, suggesting few transactions are taking place. The Russian stock market, which plummeted last week, remained closed. That has opened a rift between the pricing of some funds with heavy exposure to Russia and the value of their underlying assets.

In Europe, the pan-continental Stoxx Europe 600 fell 2.4%. The London Stock Exchange suspended trading in shares of Russia’s VTB Bank after the exchange said Bank of New York Mellon had resigned as the depositary for the company. JPMorgan Chase also halted trading of two funds because of the crisis in Ukraine.

In Asia Pacific, stock markets were mixed. Japan’s Nikkei 225 rose 1.2%, while Hong Kong’s Hang Seng Index edged up 0.2%.

Write to Hardika Singh at hardika.singh@wsj.com and Will Horner at william.horner@wsj.com