The close was a high note in what had been a choppy day for the market, as choppy as the fiscal cliff deal-making that has been yanking it around. It also marked a turnaround after five straight days of cliff-influenced losses. The Dow Jones industrial average and the Standard & Poor's 500 both climbed more than 1 percent. The Nasdaq composite index rose 2 percent.
Stocks fell at the opening of trading and struggled for direction throughout the morning. The indecisiveness overlaid a day of dramatic budget negotiations in Washington, where lawmakers were trying to hammer out a new budget deal to avert the fiscal cliff - the automatic tax increases and government spending cuts that will kick in without a budget deal.
Stocks jerked higher at midday following reports that the bare outline of a deal to avoid the cliff had been knit together. The gains faded after President Obama said in the early afternoon that a compromise was "within sight," but not finalized. Then, in the late afternoon, the indexes shot higher again.
At the close of trading, Dow Jones industrial average was up 166.03 points, finishing the year at 13,104.14. That's a gain of 7.3 percent for the year, its fourth straight year of gains.
The S&P 500 rose 23.76 to 1,426.19. The Nasdaq composite climbed 59.20 to 3,019.51. For the year the Nasdaq rose 15.9 percent.
With the fiscal cliff still closing in, investors' opinions about its potential impact varied, making its long-term effect on the market hard to guess.
Some investors are unruffled. They think that even if the United States does go over the cliff, it would be more akin to the anti-climactic Y2K scare than a true Armageddon. The cliff's impact would be felt only gradually, they reason. For example, workers might get more taxes withheld from their first couple of paychecks in the new year, but it's not as if they'd have to pay all their higher taxes up front on Tuesday.
Others are more concerned. The higher taxes and lower government spending could take more than $600 billion out of the U.S. economy and send it back into recession.