U.S. stocks ended modestly lower in choppy trading as unfolding events in Libya and their impact on oil prices seem to be the overriding factors to most investors.

The Dow Jones Industrial Average edged down 1.29 points, or 0.01 percent, to close at 12,213.09. The S&P 500 index fell 1.80 points, or 0.14 percent, to 1,320.02. The Nasdaq composite tumbled 14.05 points, or 0.51 percent, to 2,752.

On the economic front, U.S. wholesale inventories for the month of January rose 1.1 percent to a seasonally adjusted $436.88 billion, while economists expected a 0.9 percent gain. Sales gained 3.4 percent, helped by sales of cars and petroleum.

Oil prices remained near $105 a barrel as worries about a civil war erupting in Libya are increasing. Moammar Gaddafi-backed forces have reportedly launched fresh air strikes on the key oil port city of Ras Lanuf, raising fears about the vulnerability of local gas facilities and a possible humanitarian catastrophe.

Al Jazeera reported that Libyan government fighter jets were flying above the Ras Lanuf petroleum facilities, but that rebels were firing back.

Texas Instruments (NYSE: TXN) shares fell 3.12 percent after the chip maker narrowed its quarter earnings and sales forecast last Tuesday. The company now expects sales of $3.34 billion to $3.48 billion, compared with $3.27 billion to $3.55 billion projected earlier. It sees earnings of between 56 cents and 60 cents a share, compared with prior view of 54 cents to 62 cents.

Shares of Finisar Corp. (NASDAQ:FNSR) plunged 38.54 percent after the provider of optical subsystems guided fourth quarter below expectations, blaming business in China and customers adjusting inventories. Its rival JDS Uniphase (Nasdaq: JDSU) also plunged 16.67 percent.

IBM (NYSE: IBM) jumped 2.21 percent after Deutsche Bank raised its price target on the stock to $200 a share and maintained a buy rating.

Bonds rose as the yield on the benchmark 10-year U.S. Treasury slipped to 3.47 percent.