Investors took profits after a recent rise in U.S. stocks on Wednesday but a late-hour rally in Bank of America shares helped the Dow squeeze out its eighth straight day of gains.

Market participants remain confident that solid corporate earnings will inspire further advances, but a recent string of lightly traded sessions raises worries that buying interest at current levels has dried up.

Dow component Cisco Systems Inc reported quarterly results after the market close, and though the network equipment maker's profit and sales beat expectations, its margins disappointed. The stock sank 9.3 percent to $19.99 in extended trading.

If the weakness in Cisco shares hold, it could pressure early trading on Thursday. Cisco is considered a prime bellwether for the technology sector due to the breadth of its consumer base.

Energy and materials stocks weighed on indexes on Wednesday, pressured by weakness in emerging markets, a source of heavy demand for raw goods. Chevron Corp was the weakest stock on the Dow, falling 1.5 percent to $96.24, followed by Alcoa , off 1.4 percent to $17.16. The Morgan Stanley commodity-related equity index <.CRX> fell 1 percent.

We've had such a great run that we're seeing some profit-taking even though there's really no information out there that's taking us down, said Tom Wirth, senior investment officer for Chemung Canal Trust Co, which manages $1.5 billion in Elmira, New York.

Dow components Walt Disney Co and Coca-Cola Co advanced after reporting strong quarterly sales. Disney was the strongest performer on the index, surging 5.3 percent to $43.36 and Coke gained 0.4 percent to $63.15.

Earnings are very strong and they're what's keeping the market higher, Wirth said. Without Disney and Coke today, the Dow's losses would be a lot greater.

Gains in Bank of America in the final hour of trading were enough to drag the Dow into positive territory. Shares rose after WikiLeaks founder Julian Assange said privately he doesn't know if his cache of internal BofA data contains any big news or scandal, according to three people familiar with Assange's private discussions about the material.

BofA rose 0.2 percent to $14.64, erasing earlier losses.

Trading volume continued to be weak, with only a total of 7.36 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, below last year's daily average of 8.47 billion.

The Dow Jones industrial average <.DJI> was up 6.74 points, or 0.06 percent, at 12,239.89. The Standard & Poor's 500 Index <.SPX> was down 3.69 points, or 0.28 percent, at 1,320.88. The Nasdaq Composite Index <.IXIC> was down 7.98 points, or 0.29 percent, at 2,789.07.

Both the Dow and the S&P 500 are at 2-1/2-year highs.

Whole Foods Market Inc surged 8.1 percent to $58.11 after the bell after it reported quarterly earnings that topped expectations and raised its full-year profit view.

Federal Reserve Chairman Ben Bernanke told a congressional committee that the labor market remains sluggish and he continues to believe that inflation will remain subdued. Wall Street's reaction to Bernanke's comments was muted.

Shares of exchange operators rose after news that Deutsche Boerse was in advanced merger talks with NYSE Euronext . NYSE shares jumped 14 percent to $38.10 while CBOE Holdings Inc rose 4.3 percent at $25.51 as investors eyed further matchups.

In the financial sector, shares of Wells Fargo & Co dropped 2.8 percent to $33.13 after the bank said its chief financial officer will retire. The structure of the CFO's retirement raised questions, analysts said.

Almost two stocks fell for every one that rose on both the New York Stock Exchange and Nasdaq.

(Editing by Leslie Adler)