The S&P 500 broke two records during Thursday's session, climbing past its previous intraday all-time high of 1,991.39 and ending above its previous record close of 1,987.98. Both had been set on July 24. Investors are anticipating that the benchmark index will touch the 2,000 level, which it has yet to breach.

Market participants refrained from making big bets before Federal Reserve Chair Janet Yellen's speech on Friday at a policymakers' meeting in Jackson Hole, Wyoming, which could provide clues on the timing of an interest-rate hike.

"The real question will be, with the bullish economic data, will Yellen's comment in Jackson Hole remain as dovish as the market hopes it will be?" said Lawrence Glazer, managing partner at Mayflower Advisors in Boston.

Policymakers referred to as doves are viewed as being supportive of interest rates remaining low.

Some investors also remained skeptical of whether the stock market's recent gains are sustainable, pointing to light trading volume.

"We're seeing a few people jump into the market right now because things look A-OK right now. But it's a slow period ... before Labor Day, and so it isn't taking much to move the market up," said Jeff Duncan, president of Duncan Financial Management in Sunset Hills, Missouri.

The Dow Jones industrial average rose 60.36 points, or 0.36 percent, to 17,039.49. The S&P 500 gained 5.86 points, or 0.29 percent, to end at 1,992.37. The Nasdaq Composite added 5.62 points, or 0.12 percent, to 4,532.10.

The benchmark S&P 500's intraday record high was 1,994.76.

U.S. economic data gave stocks a boost. Existing home sales jumped to a 10-month high and initial jobless claims dropped sharply, painting a picture of an economy that is slowly improving.

Bank of America Corp shares jumped 4.1 percent to $16.16 after the company reached a record $16.65 billion settlement with the U.S. government related to troubled mortgage-backed securities.

Fund managers and analysts believe the settlement will let Bank of America's management focus on running the company and moving it forward. The stock's rally helped push the S&P 500 financial sector index up during the day to 312.45, its highest level since June 2008.

Technology shares, a recent area of strength, advanced, with the S&P technology index adding 0.5 percent.

Hewlett-Packard Co shares gained 5.4 percent to $37 a day after the computing company posted a surprising increase in quarterly revenue. Shares of eBay jumped 4.7 percent to $55.89 on a report that the company was mulling a spinoff of its PayPal unit as soon as next year.

Going against the day's upbeat trend was Sears Holdings, which tumbled 7.2 percent to $33.38. The stock slid after the owner of Sears department stores and the Kmart discount chain reported its ninth straight quarterly loss. Sears also said it might close more stores than planned this year.

About 4.5 billion shares traded on all U.S. platforms, according to BATS exchange data, compared with the five-day average of 5.1 billion.

(Editing by Bernadette Baum, Nick Zieminski, Megan Davies and Jan Paschal)

By Akane Otani