Updated from 4:04 p.m. EDT

Afternoon reports of violence in Iraq sent the markets lower Tuesday, but blue-chip stocks held modest gains as increased consumer confidence mixed with positive earnings releases to inspire some buying.

The Dow Jones Industrial Average closed up 33.43 points, or 0.32%, to 10,478.16 after being up as high as 10,537.35 earlier. The S&P 500 finished with a gain of 2.58 points, or 0.23%, to 1138.11. It peaked earlier at 1146.86. Those two indices outperformed the Nasdaq Composite, which ended down 4.24 points, or 0.21%, to 2032.53. The 10-year Treasury note traded up 9/32 in price, yielding 4.40%, while the dollar was higher against the yen and lower against the euro.

In an active session, more than 1.5 billion shares traded on the New York Stock Exchange, where advancers edged out decliners by about 5 to 4. On the Nasdaq, over 1.9 billion shares changed hands, and decliners held a tiny majority.

Multiple explosions shook the Iraqi town of Fallujah, according to the Associated Press, as a U.S. AC-130 gunship hammered targets in the city. Blasts and gunfire went on steadily for more than half an hour in sustained fighting, apparently in the northern Jolan district, a poor neighborhood where Sunni insurgents are concentrated.

" The Iraq war is another uncertainty that the market doesn't need at this time, along with concerns over interest rates and terrorism and so forth," said Robert Pavlik, portfolio manager at Oaktree Asset Management. "It certainly doesn't bode well for stocks.

"I think people were just moving over towards the cyclical side of the market today," he added. "They probably figure that with the prospects for more growth, these are the types of companies they want to align themselves with, rather than tech stocks that had their big run last year."

Paul Nolte, director of investments at Hinsdale Associates, said the session's divergence between the Dow and the Nasdaq is consistent with recent trends. "The Nasdaq has been strong for the last couple of weeks relative to everything else, and so I think what we're seeing now is nothing more than a break in the action," he said. "The broad market is really closer to being oversold than overbought, so this looks like just a relief rally here.

"The small-cap area is the only space that's underperforming the market, and that's continuing the theme that we've seen most of this month," he added. "Investors are rotating more to the big-cap names."

The market had jumped in the morning after the release of two economic reports. The Conference Board's consumer confidence index rose to 92.9 in April, beating consensus estimates which said the index would remain unchanged from March at 88.5. Also, existing homes sales in March came in above expectations at an annualized rate of 6.48 million, up from an upwardly revised 6.13 million in February. Economists had predicted the figure would be lower, at 6.2 million.

"Today, we seem to be shifting back to accepting good news for what it's worth," said Arthur Hogan, chief market analyst at Jefferies. "At some point in time, we have to rationalize that the Fed's going to tighten and it's not going to cripple the economy or put a stop to corporate earnings growth."