Lifted by Apple Inc, the S&P 500 rose after a Labor Department report showed initial claims for state unemployment benefits totaled a seasonally adjusted 498,000 for the week ended May 1, compared with 590,000 in the prior week.

Investors were awaiting a more comprehensive non-farm payrolls report on Friday for clues on the strength of the labor market and potentially the U.S. Federal Reserve's stance on monetary policy.

"Investors are encouraged by the low-interest rates and the stimulus that the government is putting into the economy. We're also seeing substantial increases in economic projections and earnings forecasts," said Sam Stovall, chief investment strategist at CFRA Research.

Pharmaceutical companies dropped after the White House said Biden made the decision to back a proposed waiver for COVID-19 vaccine intellectual property rights.

Shares in Pfizer Inc and Moderna Inc fell 1% or more. Johnson & Johnson and Novavax Inc ended higher after spending much of the day in negative territory.

The Nasdaq biotechnology index dropped 0.4%.

Moderna's shares cut some losses after it said countries around the globe would continue buying its COVID-19 vaccine for years even if patents on the shots are waived.

The S&P 500 financials index was the top performer among the 11 sectors, gaining 1.4%.

"One sector we are seeing a lot of opportunities in is the financial sector. We see it as one that should benefit from higher interest rates and a stronger economic recovery," said Ann Guntli, portfolio manager at Chicago-based RMB Capital.

Microsoft Corp, Apple, Facebook and Amazon.com Inc rose more than 1%.

The Dow Jones Industrial Average rose 0.93% to end at 34,548.53 points, while the S&P 500 gained 0.82% to 4,201.62.

The Nasdaq Composite climbed 0.37% to 13,632.84.

In extended trade, Square rose 3% after the mobile payments company announced a 266% jump in quarterly total net revenue.

During the trading session, Costco Wholesale jumped 2.75% after the retailer said late on Wednesday that its April sales surged 33.5%. That rally helped push the S&P 500 consumers staple index higher.

Regeneron Pharmaceuticals Inc rose 3.37% after the drugmaker reported a better-than-expected quarterly profit and said it expected demand for its COVID-19 antibody therapy to hold up.

Uber Technologies Inc tumbled 8.85% after it signaled it would pay drivers more to get cars back on the road as the pandemic recedes, and disclosed a $600 million charge to provide UK drivers with benefits.

Advancing issues outnumbered declining ones on the NYSE by a 1.33-to-1 ratio; on Nasdaq, a 1.38-to-1 ratio favored decliners.

The S&P 500 posted 121 new 52-week highs and no new lows; the Nasdaq Composite recorded 118 new highs and 155 new lows.

Volume on U.S. exchanges was 11 billion shares, compared with the 10 billion average for the full session over the last 20 trading days.

(Reporting by Shreyashi Sanyal and Sruthi Shankar in Bengaluru, and by Krystal Hu in New York; Additional reporting by Medha Singh in Bengaluru and Noel Randewich in Oakland, Calif.; Editing by Marguerita Choy and Jonathan Oatis)

By Shreyashi Sanyal and Krystal Hu