Stocks rose on Thursday, reversing earlier losses, as Boeing Co surged on encouraging news about its long-delayed 787 jetliner and oil prices rebounded.

Boeing, the top gainer on the blue-chip index, rose 8.5 percent to $51.89 after the company said the new Dreamliner would make its first flight by the end of the year.

U.S. front-month crude oil prices rose 1.6 percent, erasing hefty declines and lifting energy stocks from session lows.

The oil prices have recovered from losses and that's good for energy stocks, but also good for the overall market sentiment. It gave that boost, said Marc Pado, U.S. market strategist at Cantor Fitzgerald & Co in San Francisco.

Chevron Corp shares slipped 0.4 percent at $70.83, but were up from a session low of $69.54. The S&P energy index <.GSPE> was off 0.6 percent, improved from a decline of 1.6 percent.

The Dow Jones industrial average <.DJI> was up 39.15 points, or 0.41 percent, at 9,582.67. The Standard & Poor's 500 Index <.SPX> was up 1.78 points, or 0.17 percent, at 1,029.90. The Nasdaq Composite Index <.IXIC> was up 1.27 points, or 0.01 percent, at 2,025.70.

The stock of bailed-out insurer American International Group Inc supported the financial sector, surging 27.3 percent to $47.96 after the new chief executive, Robert Benmosche, told Reuters on Wednesday he did not favor a fire sale of its assets.

He also said in an interview that in a year, people will say the company is performing well.

The economy shrank less than expected, the government reported, but was unchanged from last month's estimate, while jobless claims rose modestly higher than forecast.

Analysts cited light summer volume and caution over a potential pullback for the market's lackluster performance this week.

Technology shares were among the decliners, weighing on the Nasdaq index, with Research In Motion Ltd falling 1.5 percent to $73.68. The PHLX semiconductor index <.SOXX> was off 0.2 percent, with SanDisk Corp down 0.5 percent at $17.60.

(Editing by Jeffrey Benkoe)