Stocks finished broadly higher Tuesday after consumer confidence fell less than some analysts had feared. All 10 company groups that make up the S&P 500 index rose by more than 0.3 percent.
The S&P 500 rose 9.25 points, or 0.7 percent, to 1,319.44. The Dow Jones industrial average gained 81.13 points, or 0.7 percent, to 12,279.01. The Nasdaq composite rose 26.21, or 1 percent, to 2,756.89.
Rising gas prices helped drag down consumer confidence in March. The Conference Board said its confidence index dropped to 63.4 from 72 in February.
The fall comes after five straight months of gains, but some economists had expected the decline to be even worse. Goldman Sachs had forecast a drop to 60, believing that high gas prices would pinch spending. The University of Michigan confidence survey also took a steep fall last week.
The Conference Board survey also had a surprising result: The index measuring consumers' assessment of current conditions gained from February, putting it at the highest level since November 2008.
"Now you can't say things are going worse than they were a month ago," said Thomas Simons, money market economist at Jefferies & Co.
Home Depot Inc. rose 2.9 percent, the most of the 30 companies in the Dow Jones industrial average. The retailer said it would buy $1 billion of its own stock with cash from selling bonds.
Two stocks fell for every one that rose on the New York Stock Exchange. Consolidated volume came to 3.6 billion shares.