The major stock indexes spent most of Thursday in the red for the third day in a row, as investors continued to be concerned about the economies of Europe and the U.S. But stocks rallied, and the Dow finished slightly ahead.
The Dow Jones industrial average closed up 19.61 points, or 0.15 percent, at 13,145.82.
The Standard & Poor's 500 closed down 2.26 points, or 0.2 percent, at 1,403.28.
The Nasdaq composite index closed down 9.6 points, or 0.3 percent, at 3,095.36.
For the week:
The Dow is up 65.09 points, or 0.5 percent.
The S&P 500 is up 6.17 points, 0.4 percent.
The Nasdaq is up 27.44 points, or 0.9 percent.
For the year:
The Dow is up 928.26 points, or 7.6 percent.
The S&P 500 is up 145.68 points, or 11.6 percent.
The Nasdaq is up 490.21 points, or 18.8 percent.