(Updated with closing prices.)

NEW YORK (

TheStreet

) - The market may have just exhausted all available energy to a certain level, said one observer as profit taking followed a better than expected report on national production early Thursday. But stocks still found their way higher.

With some help from an 8.4% increase in

Boeing

(BA) - Get Report

, the

Dow Jones Industrial Average

reversed to gain 37.11 points, or 0.4%, to 9580.63, while the

S&P 500

added 2.86 points, or 0.3%, to 1030.98. The

Nasdaq Composite

also turned, gaining 3.3 points, or 0.2%, to 2027.73.

Financial stocks, which held up through most of the day, were outperforming with the KBW Bank index up 1.3%. Energy names also lent support to the afternoon comeback as crude oil futures rebounded to ultimately gain $1.06 to $72.49.

Economic data, although some of it was better than expected, did little to enthuse stocks earlier in the day.

"It's one of those things, when you think about the dynamics of the market, which tends to exhaust available energy to a certain level and then there's profit taking," says Brian Bethune, chief U.S. financial economist at HIS Global Insight. "This is a classic example the market could not sustain much as far as gains the last few days despite positive news."

But profit taking in the morning presented itself as an opporutnity for afternoon buying.

Among the day's movers, Boeing shares rose 8.4% after it said the

787 Dreamliner

airplane is now expected to make its first flight by year-end after multiple delays.

Also,

American International Group

(AIG) - Get Report

surged 26.9% after

Reuters

reported

that new Chief Executive Officer Robert Benmosche said he did not favor a quick sale of the company's assets.

"Just selling this company and getting whatever you can get for it and hope that it covers whatever debts you have, it's not for me. I don't think that's the way to go," he said.

Early in the day, the government said second-quarter

GDP

shrank by 1% according to the most recent data, in line with its previous estimate. Economists were expecting the government to revise that to a more severe 1.5% drop.

Other data showed weekly

jobless claims

fell to 570,000 last week from an upwardly revised 580,000 the week prior. That was slightly more than expectations for 565,000, however.

Home stocks were an area of weakness after

Toll Brothers

(TOL) - Get Report

reported

a widened and wider-than-expected third-quarter loss but said it saw "signs for optimism." Shares fell 1.2%.

KB Home

(KBH) - Get Report

and

Pulte Homes

(PHM) - Get Report

fell 1.3% and 1.4%, respectively.

Lennar

(LEN) - Get Report

and

DR Horton

(DHI) - Get Report

lost 1.5% and 1.9%, respectively.

Meanwhile, data continued to show signs of economic weakness abroad.

Bloomberg

reported that its purchasing managers index showed European retail sales fell for the 15th month in August, to 47.1 from 47.3. Any figure below 50 indicates a contraction.

Stocks overseas were mostly lower. In Europe, London's FTSE 100 and the DAX in Frankfurt fell 0.6% and 1.3%, respectively. In Asia, the Nikkei in Japan fell 1.6%, and the Hang Seng in Hong Kong edged down 1%.

-- Written by Elizabeth Trotta in New York.