U.S. stocks rose on Tuesday in a light volume session, erasing initial declines as investors moved into sectors that lost ground after Japan's earthquake as the quarter draws to a close.

The S&P 500 index has risen 4.5 percent in the first quarter and was on track for its seventh positive quarter in the last eight.

Technology and retail stocks were among the better- performing sectors on Tuesday, as investors found value in stocks that fell in the pullback following the earthquake. The S&P Information Technology index <.GSPT> had lost as much as 4 percent in the aftermath of the disaster in Japan, while the S&P Retail index <.RLX> dropped as much as 2.1 percent.

The S&P Information Technology Index was up 0.5 percent on Tuesday and the S&P Retail Index was up 1.1 percent.

A lot of stocks got taken down sharply as a result of what was going on in Japan, and very unfairly, particularly in the technology space -- and you are seeing technology and retail kind of lead the charge higher. said Peter Kenny, managing director at Knight Equity Markets in Jersey City, New Jersey.

Home Depot Inc , up 2.7 percent at $37.63, was among the Dow's best performers after the home improvement retailer said it would buy back $1 billion of outstanding shares through an accelerated program.

The Dow Jones industrial average <.DJI> gained 60.55 points, or 0.50 percent, to 12,258,43. The Standard & Poor's 500 Index <.SPX> rose 5.15 points, or 0.39 percent, to 1,315.34. The Nasdaq Composite Index <.IXIC> climbed 19.30 points, or 0.71 percent, to 2,749.98.

Amazon.com Inc rose 2.7 percent to $173.88 after it introduced a service offering remote access to music, ahead of rivals Apple Inc and Google Inc .

Cisco Systems gained 1.1 percent to $17.32 after it said it plans to buy software company newScale Inc for an undisclosed amount to boost its cloud computing services.

Investors shrugged off economic data that showed U.S. consumer confidence fell in March as households worried about inflation, while home prices dropped for the seventh straight month in January.

On the downside, Apollo Group fell 7.2 percent to $39.30 after the education company said new enrollment fell 45 percent in second quarter.

Lennar Corp , the third-largest U.S. homebuilder, fell 2 percent to $19.36 after swinging to a first-quarter profit, but reporting a drop in revenue.

(Reporting by Chuck Mikolajczak; Editing by Jan Paschal)