Major U.S. stock indexes ripped higher Thursday after Senate Majority Leader Chuck Schumer said lawmakers had reached a deal on a short-term debt-limit extension, which would put off a possible government default for several months.

The stock market turned decidedly upward, with everything from shares of technology companies to energy firms to manufacturers and miners rising. Stocks hit their session highs following Sen. Schumer’s remarks from the Senate floor and continued to trade near those levels in the afternoon. While...

Major U.S. stock indexes ripped higher Thursday after Senate Majority Leader Chuck Schumer said lawmakers had reached a deal on a short-term debt-limit extension, which would put off a possible government default for several months.

The stock market turned decidedly upward, with everything from shares of technology companies to energy firms to manufacturers and miners rising. Stocks hit their session highs following Sen. Schumer’s remarks from the Senate floor and continued to trade near those levels in the afternoon. While the Senate must still vote on the deal, investors appeared ready to remove the debt ceiling as an obstacle to further gains.

“Right now, there are loads of fears out there. It just takes a couple of positive developments and suddenly that picture changes,” said Lewis Grant, an equities portfolio manager at Federated Hermes.

Investors also got some relief on the energy front. Oil prices fell further from their recent highs after U.S. stockpiles grew more than expected, soothing some inflation concerns. European natural gas prices slid after Russian President Vladimir Putin said Wednesday that Moscow was ready to work on stabilizing the global energy market.

Fresh figures showed that 326,000 Americans applied for first-time unemployment benefits in the week ended Oct. 2, down from 364,000 the week prior, further boosting investor sentiment.

The Dow Jones Industrial Average rallied about 490 points, or 1.4%, to 34903. The S&P 500 added 1.3%. The Nasdaq Composite rose even higher as technology stocks recouped recent losses, lifting the benchmark up 1.6%. 

Thursday’s gains put stocks on firm footing for the week. All three major benchmarks are up at least 1.2% over the last four trading days. That marks a full recovery from Monday losses, when a selloff in Facebook stock and shares of other big technology companies rippled through the market. 

“A temporary deal should help reduce debt-ceiling related market volatility over the next few weeks as attention shifts toward December,” said Mark Haefele, chief investment officer at UBS Global Wealth Management, in a note to clients.

As the federal debt and budget deficits grow in Washington, it’s unclear whether Democrats and Republicans are concerned. WSJ's Gerald F. Seib examines where each party stands on the issue. Photo illustration: Todd Johnson

On Thursday, technology and other growth stocks rallied. Shares of Apple and Google parent Alphabet rose more than 1%. Twitter rose even higher, adding nearly 5%. The company said Wednesday it would sell mobile ad firm MoPub to Applovin for $1.05 billion in cash.

Cyclical stocks also moved higher, showing investors’ willingness to snap up stocks at large. General Motors advanced 4.6%, while Ford Motor rose 5.4% . 

Concerns over whether the Treasury will be able to raise money have weighed on investors.

Photo: brendan mcdermid/Reuters

Energy stocks also posted decent gains. Schlumberger rose 4%, while Marathon Oil added 2.1%.

Financial stocks rose 1%, and bond yields continued to creep up. The yield on the benchmark 10-year Treasury note rose to 1.567% Thursday from 1.524% a day earlier. Yields and prices move inversely. 

In Europe, the pan-continental Stoxx Europe 600 index jumped 1.6%, with gains led by the basic resources and auto sectors.

Indexes in Asia also closed higher. Hong Kong’s Hang Seng climbed 3.1%, led by gains in technology companies. Shares of Chinese Estates (Holdings) rose 32% in Hong Kong on Thursday after its majority shareholders offered to take the company private. The group is a major shareholder of embattled property giant China Evergrande Group.

South Korea’s Kospi rallied 1.8%. The Nikkei 225 added 0.5%.

Write to Caitlin Ostroff at caitlin.ostroff@wsj.com and Michael Wursthorn at michael.wursthorn@wsj.com