By Alexander Osipovich and Joe Wallace

U.S. stocks rallied Thursday after new data showed a drop in the number of Americans filing for unemployment -- although they remain at historically high levels.

The Dow Jones Industrial Average climbed 138 points, or 0.5%, in afternoon trading, putting it on track for three consecutive days of gains. The advance has lifted the blue-chip index back to levels not seen since early March.

The S&P 500 and the Nasdaq Composite both rose 0.8%.

U.S. workers filed just over 2.1 million jobless claims last week, extending a downward trend, but still at sharply elevated levels from before the pandemic.

States and cities have been moving ahead with plans to let businesses reopen, fueling optimism that the economy has turned a corner. New data showed U.S. gross domestic product fell at a 5% rate in the first quarter, slightly steeper than initially estimated and the largest quarterly rate of decline since the last recession.

"There is some optimism that the U.S. economy is moving forward," said Jeffrey Schulze, an investment strategist at ClearBridge Investments. "It's also important that there are no signs of a second wave of infections."

Investors shrugged off concerns that fresh tensions between the U.S. and China could lead to a renewed trade war. China forged ahead on Thursday with a resolution to impose national-security laws on Hong Kong in a bid to crush anti-Beijing protests.

That came a day after the House of Representatives passed a bill to sanction Chinese officials involved in the suppression of Muslim minority groups, and the State Department determined that Hong Kong no longer has a high degree of autonomy from China -- a move that could open the way for President Trump to revoke special arrangements on trade.

"It's just another potential concern on top of Covid," said Brian O'Reilly, head of market strategy at Italian asset manager Mediolanum. "Whether we actually get into trade war 2.0 -- I think even in a second term for Trump, they'd be reticent to go down that path."

Hong Kong's Hang Seng Index fell 0.7%, even as most other Asian and European indexes posted gains. The pan-continental Stoxx Europe 600 rose 1.6%, while Japan's Nikkei 225 jumped 2.3%.

In the U.S., nine of the S&P 500's 11 sectors were higher, with utilities and health-care the best performers. Only energy and financial stocks declined.

Dollar Tree shares jumped 11% after the discount retailer posted stronger-than-expected earnings for the first quarter, boosted by a surge in demand for essential goods as homebound consumers stocked up during the pandemic.

Shares of Boeing rose 2% after the aerospace giant laid out plans to cut more than 13,000 jobs. HP shares fell 12% after the information-technology company's first-quarter profit fell and it pulled financial projections for the year.

A key question for investors is whether economically sensitive stocks can extend their recent rally, said Hugh Gimber, a strategist at J.P. Morgan Asset Management. "It's been the most beaten-up sectors that have really caught the bounce," he said, pointing to gains for shares in U.S. banks and travel companies.

The rally in shares of technology companies has paused in recent days, having powered much of the recovery in U.S. stocks since March. They could come under further pressure in response to a draft executive order that Mr. Trump is expected to sign Thursday, Mr. Gimber said. The order would seek to limit the broad legal protection that federal law currently provides social-media and other online platforms, according to people familiar with the draft.

Twitter shares dropped 2.5%. Mr. Trump lashed out at the company this week after it added fact-checking notices to two of his tweets.

Stocks are likely to pull back at some point given the degree of uncertainty surrounding the global economy as lockdown measures are relaxed, said Michael Drummey, head of U.S. equity risk trading at Mizuho Americas LLC. "The market is acting in a way that doesn't really line up with that uncertainty," he said. "We have a FOMO rally -- a fear of missing out."

Upbeat sentiment about the economy spilled over into the energy market, with U.S. oil futures rising 90 cents a barrel, or 2.7%, to $33.71, despite a larger-than-expected increase in U.S. crude inventories.

The yield on 10-year U.S. Treasury bonds rose to 0.703%, from 0.677% on Wednesday, as investors sold government bonds. Bond yields move in the opposite direction from prices.

Frances Yoon contributed to this article.

Write to Alexander Osipovich at alexander.osipovich@dowjones.com and Joe Wallace at Joe.Wallace@wsj.com