U.S. stocks rose Thursday, with Wall Street indexes recouping most of Wednesday’s losses, led by gains among semiconductor and materials stocks.

The S&P 500 rose 63.92 points, or 1.4%, to 4520.16, the technology-focused Nasdaq Composite Index climbed 269.23 points, or 1.9%, to 14191.84, and the Dow Jones Industrial Average gained 349.44 points, or 1%, to 34707.94. All three indexes declined in the previous session as concerns about rising energy prices and supply shortages again rattled investors.

All 11 sectors in the S&P 500 rose. The tech segment climbed 2.7%, followed by materials with a 2% gain. Energy, by far 2022’s best performing sector, was the worst performing group on Thursday but still managed to eke out a 0.1% gain.

Stocks have come under pressure this year amid rising inflation, mixed economic signals, the war in Ukraine and the continuing disruptions from the pandemic. The S&P 500 is down 5.2% in 2022, while the Nasdaq, off 9.3%, is in its longest bear market since 2008.

That slump, however, comes on the back of a long rally. Wednesday marked the two-year anniversary of the stock market’s pandemic lows. Since then, the S&P 500 and Nasdaq have doubled, while the Dow is up nearly 90%.

The market looks like the February lows won’t be breached and equities are entering a more temperate period where investors will try and digest everything that has happened so far, said JMP Securities analyst Mark Lehmann. “We’ve had a lot in a very short time,” he said. “The market’s trying to figure itself out.”

Thursday’s market gains followed a bag of mixed economic data.

The number of Americans applying for first-time unemployment benefits fell to 187,000 in the week ended March 19—the lowest level since September 1969—down from 215,000 in the week prior. 

But new orders for durable goods—products designed to last at least three years—fell 2.2% in February from the month prior after auto production was again held back by supply-chain bottlenecks and Boeing

had a relatively weak month for aircraft orders. 

Investors have grappled with how Russia’s war with Ukraine will put additional pressure on supply chains that are already disrupted from Covid-19. A climb in oil prices, which remain above $100 a barrel, have added to concerns that consumers could see higher prices for energy and even products like plastic wrap or lawn fertilizer. Federal Reserve officials have penciled in a series of additional interest-rate increases to limit inflation this year.

U.S. crude fell 2.3% to $112.34 a barrel.

“Through mid-February, it was all about rising rates, and then it was all about the war, and what’s concerning now is that they’ve combined,” said Daniel Morris, chief market strategist at BNP Paribas Asset Management. “The challenge in this environment is what do you buy. You can’t sit in cash. It is a ‘least-bad option’-type of market.”

Among individual stocks, shares of Nikola rose 52 cents, or 5.7%, to $9.66 after the company confirmed that production has begun on its electric commercial truck, the Tre.

Uber gained $1.64, or 5%, to $34.70 after saying it would list all New York City taxis on its app.

In the semiconductor industry, Nvidia rose $25.16, or 9.8%, to $281.50 and Intel rose $3.35, or 6.9%, to $51.62, its biggest one-day gain since January 2021, as investors bet booming demand for chips would overwhelm short-term logistics issues.

Overseas, Russia’s stock market jumped in its first limited trading session since the West unveiled punishing sanctions nearly a month ago. The benchmark MOEX index added about 4%. 

The increase is unlikely to be interpreted as a sign that all is well with the Russian economy. Only 33 shares out of 50 shares on the index were allowed to trade. To prevent a steep selloff, Russia’s central bank banned short selling, and blocked foreigners, who make up a huge chunk of the market, from selling their shares. 

The move will also help prevent the ruble from weakening, as foreign investors would likely sell their ruble-denominated shares and then move out of the ruble for the dollar or euro. Russia’s currency has trimmed some of its losses against the dollar in recent sessions, trading at 98 rubles to the dollar Thursday. 

In bond markets, the yield on the benchmark 10-year Treasury note ticked up to 2.340% from 2.320% Wednesday. Yields and prices move inversely.

Traders worked on the floor of the New York Stock Exchange on Tuesday.

Photo: BRENDAN MCDERMID/REUTERS

In other foreign markets, the pan-continental Stoxx Europe 600 fell 0.2%. Major indexes in Asia were mixed. China’s Shanghai Composite fell 0.6%, and Hong Kong’s Hang Seng declined 0.9%. Japan’s Nikkei 225 added almost 0.3%.

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