Stocks gained on Thursday, led by the retail sector after surprisingly strong March sales as a rebound in consumer spending was seen as a harbinger for strength in corporate earnings.

Investors snapped up retailers' shares after top U.S. chains reported a record increase in March same-store sales. The early Easter holiday and an improving job market last month helped retailers beat Wall Street's forecast.

Online merchant Amazon.com jumped 4.4 percent to $140.75, a 2010 intraday high for the stock, leading the S&P 500 higher. The S&P retail index <.RLX> rose 1.1 percent.

Earlier in the day, another wave of worry about Greece had pushed stocks lower. Concerns about Greece's ability to pay its debt have weighed on investor psyche for months.

Investors unloaded Greek assets on Thursday as the government bond market priced in the threat of a liquidity crunch for the euro zone member -- even as Athens sought to reassure markets it was not at risk of default.

An index of U.S.-listed stocks of Greek companies <.BKGR> fell 2 percent.

The consumer seems to be coming out of hibernation and the latest data shows stabilization in (economic) growth, said Thomas Nyheim, portfolio manager at Christiana Bank & Trust Co. in Greenville, Delaware.

He said the positive news coming from the United States overshadowed the issues regarding Greek fiscal stability.

The Dow Jones industrial average <.DJI> gained 31.36 points, or 0.29 percent, to 10,929.88. The Standard & Poor's 500 Index <.SPX> rose 3.18 points, or 0.27 percent, to 1,185.63. The Nasdaq Composite Index <.IXIC> added 3.66 points, or 0.15 percent, to 2,434.82.

Early in the day, major U.S. retail chains reported a record 9.1 percent jump in March same-store sales -- beating the forecast for a 6.3 percent gain, according to Thomson Reuters data. Of the 28 retailers that Thomson Reuters tracks, more than 90 percent topped estimates.

The pick-up in consumer spending, which accounts for roughly two-thirds of U.S. economic activity, could point to stronger corporate earnings and further boost stocks.

Target Corp shot up 3.5 percent to $55.88. The S&P consumer discretionary index <.GSPD> rose 0.9 percent, leading the benchmark S&P 500's advance.

Shares of United Airlines parent UAL Corp climbed 8.9 percent to $20.63 on Nasdaq and US Airways Group surged 12.9 percent to $7.70 on the New York Stock Exchange in the wake of news that the two airlines were in merger talks.

In the latest snapshot of the job market, initial claims for state unemployment benefits unexpectedly rose 18,000 to a seasonally adjusted 460,000, the Labor Department said, reflecting volatility in the data associated with the Easter holidays. Economists expected first-time claims to slip to 435,000.

But a hopeful sign for the job market came from continuing jobless claims, which fell to the lowest since December 2008.