Stocks rose on Thursday, recovering most of the week's losses, after Greece moved closer to a bond swap with private creditors to avoid a messy default.

Earlier in the week, the S&P 500 posted its first big loss for the year on fears of a disorderly default in Greece. Now it is down just 0.3 percent for the week, and Thursday's advance was led by shares in the materials and industrial sectors.

Greece was able to convince enough private bondholders to accept a restructuring on Thursday, moving it closer to unlocking aid needed to avoid a disruptive default.

Today's move is based on the assumption that the Greek deal is resolved. But this is an important week, as we still have the jobs report due tomorrow, said Jack DeGan, chief investment officer at Harbor Advisory Corp in Portsmouth, New Hampshire.

Expectation for Friday's U.S. jobs data are for a net gain of 210,000 jobs in February. An unexpected rise in new U.S. weekly jobless claims on Thursday was not enough to change perceptions that the labor market was strengthening - a major catalyst in the current rally.

As long as it comes in line with forecast, or even a little bit lower, it will strengthen the current upward trend, DeGan said.

Apple shares jumped 2.1 percent to $541.99. Analysts said Apple will continue to retain the lion's share of the tablet market as its new 4G-enabled iPad readies for competition from Windows 8-based products, and a cheaper iPad 2 takes on Amazon's popular Kindle Fire.

An S&P index of basic materials stocks <.GSPM> shot up 1.6 percent, leading the S&P 500's advance. The Reuters/Jefferies CRB commodities index <.CRB> rose 0.6 percent, shifting into positive mode after four straight down sessions.

The Dow Jones industrial average <.DJI> gained 70.61 points, or 0.55 percent, to 12,907.94 at the close. The Standard & Poor's 500 Index <.SPX> rose 13.28 points, or 0.98 percent, to 1,365.91. The Nasdaq Composite Index <.IXIC> advanced 34.73 points, or 1.18 percent, to close at 2,970.42.

Coach Inc , the luxury leather goods retailer, hit a record high of $78.22 after the overall positive tone of a presentation at a Bank of America conference. The stock later eased, but it still ended up 4.6 percent at $76.79.

American International Group Inc fell 3.9 percent to $28.31 after the U.S. Treasury priced its $6 billion offering of AIG stock at $29 a share. That would allow the Obama administration to break even on its investment in the insurer as it winds down bailout programs from the financial crisis.

The S&P financial sector <.GSPF> gained 1 percent while the KBW insurance index <.KIX> climbed 0.7 percent.

The Dow was pressured by McDonald's Corp . The stock fell 3.2 percent to $96.96 after the world's largest hamburger chain reported a smaller-than-expected rise in February sales.

Hovnanian Enterprises shares jumped 13.4 percent to $2.79, pushing the PHLX housing sector index <.HGX> up 3 percent.

Volume was light, with about 6.1 billion shares traded on the New York Stock Exchange, NYSE Amex and Nasdaq, below the daily average of 6.9 billion.

Advancers outnumbered decliners by a ratio of 4 to 1 on the New York Stock Exchange. On the Nasdaq, about 18 stocks rose for nearly every seven that fell.

(Reporting By Angela Moon; Editing by Jan Paschal)