U.S. stocks closed lower after uneven trading Tuesday as fears about the "fiscal cliff" and Greece tipped major indexes between gains and losses. A surge in Home Depot's stock prevented a steeper drop for the Dow Jones industrial average.

The Dow closed down 58.90 points at 12,756.18. It would have been lower without support from Home Depot, whose stock jumped 3.63 percent to $63.38 after the big-box retailer beat expectations for fiscal third-quarter earnings. It is benefiting from the gradual housing recovery and rebuilding efforts after superstorm Sandy.

advertisement | advertise on newsday

Stocks had opened lower after European leaders postponed the latest aid package for Greece. The Dow turned positive in the first hour of trading, rose solidly through the morning, gaining up to 83 points, and starting about 2 p.m. slid steadily into the red.

Other indexes also closed lower. The Standard & Poor's 500 index lost 0.40 percent to 1,374.53. The Nasdaq composite index fell 0.70 percent, to 2,883.89.

Investors are trading against the backdrop of the "fiscal cliff," a set of U.S. government spending cuts and tax increases that will take effect automatically at the beginning of next year unless U.S. leaders reach a compromise before then.