Stocks extended their gains on Thursday, with the Nasdaq up 1 percent as Greece moved closer to concluding a bond swap with private creditors that is needed to prevent a messy default.

The S&P 500 continued to claw back after a string of losses sent the index down more than 2 percent in three sessions. It is still lower for the week.

The Dow Jones industrial average <.DJI> was up 66.41 points, or 0.52 percent, at 12,903.74. The Standard & Poor's 500 Index <.SPX> was up 12.19 points, or 0.90 percent, at 1,364.82. The Nasdaq Composite Index <.IXIC> was up 31.12 points, or 1.06 percent, at 2,966.81.

(Reporting by Ryan Vlastelica; Editing by Jan Paschal)