The Dow managed a slim gain on Thursday while the S&P 500 and the Nasdaq shook off most of their earlier losses to end slightly lower, as investors took advantage of a selloff to buy blue chips that have been rallying throughout the quarter.

The Dow industrials sharply erased losses in the last half hour of trading and closed up 0.2 percent.

Despite the S&P 500 marking its third day of declines, the benchmark index is still up 2.8 percent for the month and nearly 12 percent for the year. It has gained almost 12 percent this quarter, its best start to the year since 1998 and its best quarter since the third period of 2009.

It's hard to take away the end-of-the-quarter price action. People are buying winning stocks, and the claims data, which was a bit shy of expectations, is still showing that we are at OK levels. That's enough to keep investors happy, said Nicholas Colas, chief market strategist at ConvergEx Group in New York.

Among Dow components, Coca-Cola Co rose 1.6 percent to end at $73.81 after hitting a new 52-week high of $74.39 earlier.

New U.S. jobless claims fell to a four-year low last week but fell short of forecasts and the previous week's figures were revised higher. Analysts said the recent declines in weekly claims may be leveling off, a sign that improvement in the job market may be stalling.

An S&P index of financials <.GSPF>, a group closely tied to prospects for economic growth, fell 1 percent, worst of the 10 S&P 500 sectors. Wells Fargo & Co lost 1.5 percent to $33.94.

The Dow Jones industrial average <.DJI> rose 19.61 points, or 0.15 percent, to 13,145.82 at the close. But the Standard & Poor's 500 Index <.SPX> slipped 2.26 points, or 0.16 percent, to 1,403.28. The Nasdaq Composite Index <.IXIC> shed 9.60 points, or 0.31 percent, to 3,095.36.

Other data showed U.S. household income grew at a faster pace in the fourth quarter than previously thought, which could help underpin spending this quarter, according to the Commerce Department's final estimate of growth in gross domestic product for the quarter.

Some analysts are looking for a market pullback early in the second quarter after the strong early run as investors seek confirmation that the economy is not about to slow.

Shares of JetBlue Airways tumbled 4.2 percent to $5.00 on heavy volume after Lufthansa said it would offer a bond that was exchangeable into up to 4.67 million shares of JetBlue, a move seen as dilutive.

Best Buy Co Inc slid nearly 7 percent to $24.77 and was the S&P 500's biggest decliner. The electronics retailer reported weaker-than-expected sales, and said it will close 50 big-box stores and cut 400 jobs.

Red Hat Inc surged 19.5 percent to $61.43 - its highest since 2000 - after the business software maker's profit beat expectations for the fifth straight quarter. Earlier, the stock climbed as high as $61.71.

In the retail sector, the shares of watch and accessories company Fossil Inc rose 0.8 percent to $133.67. Fossil Inc will replace Medco Health Solutions Inc in the S&P 500 as Express Scripts Inc acquires Medco in a deal expected to be completed soon. The date of the index change has yet to be announced.

About 6.80 billion shares traded on the New York Stock Exchange, the Nasdaq and the Amex. For the year to date, the daily average volume is 6.83 billion.

Decliners outnumbered advancers on the NYSE by a ratio of about 3 to 2, while on the Nasdaq, seven stocks fell for every five that rose.

(Editing by Jan Paschal)