The day's gain put the S&P 500 on track to end the month about 3.6 percent higher, while the Dow was up 3.3 percent for the month so far. The Nasdaq was up 4.9 percent.
Stocks have been volatile recently and closely tied to alternating views of the future of the Fed's loose monetary policy. Shares tumbled on Wednesday on concern the Fed would curb its bond-buying because of signs the economy was strengthening. U.S. Treasury bond yields rose to the highest in 13 months the same day, also influenced by concern about possible Fed tapering.
"It won't be until around September before we really hear about possible changes in Fed (policy), but the market is volatile because at these levels, profit-taking is part of a hedging method to protect against possible downsides," said Randy Frederick, director of trading and derivatives at Charles Schwab in Austin, Texas.
"After the profit-taking, the market moves right back up because it's a great buying opportunity, like today."
The Dow Jones industrial average was up 21.73 points, or 0.14 percent, at 15,324.53. The Standard & Poor's 500 Index was up 6.05 points, or 0.37 percent, at 1,654.41. The Nasdaq Composite Index was up 23.78 points, or 0.69 percent, at 3,491.30.
Data showed first-time claims for unemployment benefits unexpectedly rose in the latest week while the government's latest reading on first-quarter gross domestic product came in slightly below forecasts.
Loose monetary policies by central banks around the world have helped drive both the Dow and the S&P 500 to record highs. The S&P 500 is up more than 16 percent this year so far.
Even if U.S. economic data signals strength, "the stock market has yet to fully embrace the notion that the economy has reached take-off velocity and is ready to contend with a removal of stimulus," said Andrew Wilkinson, chief economic strategist Miller Tabak & Co in New York.
Pending home sales rose 0.3 percent in April to the highest since April 2010, but analysts had expected a 1.1 percent rise.
In company news, Costco Wholesale Corp, the largest U.S. warehouse club chain, reported third-quarter earnings that beat expectations by a penny, though sales were below forecasts. Shares fell 0.9 percent to $111.88.
Semiconductors were higher after chipmaker Avago Technologies forecast current-quarter revenue largely above expectations. Avago shares jumped 9.8 percent to $37.82 while the PHLX semiconductor index climbed 1.5 percent.
NV Energy Inc surged 22.5 percent to $23.62 after a unit of Berkshire Hathaway Inc agreed to buy the electric utility for $5.6 billion. Berkshire class B shares rose 1.6 percent to $114.84.
Shares of EMC Corp, the data storage equipment makers, rose 5.4 percent to $24.93 after instituting a quarterly dividend and increasing its stock buyback program to $6 billion from $1 billion.
Volume was roughly 6.5 billion shares traded on the New York Stock Exchange, the Nasdaq and the NYSE MKT, slightly above the average daily closing volume of about 6.4 billion this year.
Advancers outpaced decliners on the NYSE 1,756 to 1,208. On the Nasdaq, advancers beat decliners 1,728 to 772