Stocks extended their gains on Thursday, with the Dow turning positive and the Nasdaq hitting a session high despite some discouraging data earlier.

Initial jobless claims unexpectedly rose in the latest week and stayed at elevated levels, while U.S. gross domestic product rose at an annual rate of 1.8 percent in the first quarter, unchanged from the previous estimate and below analysts' expectations for more robust growth.

Jim Awad, managing director at Zephyr Management in New York said the market's midday comeback in the face of weak data could be a positive sign.

It speaks to the internal strength of the market that people think the internal momentum hasn't been broken yet, he said.

The Dow Jones industrial average <.DJI> was up 1.51 points, or 0.01 percent, at 12,396.17. The Standard & Poor's 500 Index <.SPX> was up 2.72 points, or 0.21 percent, at 1,323.19. The Nasdaq Composite Index <.IXIC> was up 17.68 points, or 0.64 percent, at 2,779.06.

(Reporting by Ryan Vlastelica and Ed Krudy; Editing by Jan Paschal)