Stocks rose on Thursday, building on their best day in eight weeks in the previous session, as data showed pending home sales improved and initial jobless claims declined.

The National Association of Realtors said pending sales of previously owned homes rose unexpectedly in July, suggesting a market decline was close to bottoming.

Also, first-time claims for state unemployment benefits dropped for a second straight week.

(With) the home sales numbers, it's hard to overlook the fact the year-over-year number was down 20 percent, but the month-over-month number was better than expected, said Stephen Massocca, managing director at Wedbush Morgan in San Francisco. Everyone is pretty down in the mouth, so it doesn't take much to get people happy.

The PHLX Housing index <.HGX> climbed 2 percent.

New orders received by U.S. factories edged up in July after two straight declining months on robust demand for new transportation equipment.

The reports comes before Friday's key nonfarm payroll report.

The Dow Jones industrial average <.DJI> added 13.78 points, or 0.13 percent, to 10,283.25. The Standard & Poor's 500 Index <.SPX> gained 5.62 points, or 0.52 percent, to 1,085.91. The Nasdaq Composite Index <.IXIC> rose 14.27 points, or 0.66 percent, to 2,191.11.

U.S. retailers posted better-than-expected sales in August as consumers sought bargains during the key back-to-school season.

Costco Wholesale Corp gained 1 percent to $58.38 after the largest U.S. warehouse club operator reported better-than-expected same-store sales.

The Morgan Stanley Retail index <.MVR> rose 2.1 percent.

(Reporting by Chuck Mikolajczak; editing by Jeffrey Benkoe)