Stocks ended slightly lower on Monday on stalled Greek debt talks, but an afternoon rally cut losses in a sign of the underlying resilience the market has shown early in the year.

The Dow Jones industrial average <.DJI> shed 7.04 points, or 0.06 percent, to 12,653.42. The Standard & Poor's 500 Index <.SPX><.INX> dropped 3.35 points, or 0.25 percent, to 1,312.98. The Nasdaq Composite Index <.IXIC> lost 4.61 points, or 0.16 percent, to 2,811.94.

(Reporting By Chuck Mikolajczak; Editing by Kenneth Barry)