Stocks edged higher on Monday as a flurry of acquisition activity boosted optimism about share prices and oil prices eased from earlier highs sparked by tensions in the Middle East.

Western Digital Corp jumped 16.7 percent to $35.02 as the world's No. 2 computer hard drive maker agreed to buy Hitachi Ltd's <6501.T> hard disk drive operations for about $4.3 billion in cash and stock.

Brent crude gained 0.8 percent to $116.79 a barrel after hitting a high of $118.50, while U.S. oil futures were up 0.3 percent to $104.75 as fighting in Libya disrupted the nation's oil supplies and investors remained concerned about wider disruptions in the region.

Government forces struck at rebels in Libya's east and were reported attacking a town near Tripoli as concern grew over civilian suffering and a growing refugee exodus.

OPEC is contemplating holding an extraordinary meeting, Qatar's Energy Minister said, but he added there was no supply shortage in the market.

There is a lot out there, whether it is rising commodity prices, specifically rising energy prices, the ongoing risk associated with North Africa, you pick the country, rising rates on the stage for Trichet and the (European Central Bank), said Peter Kenny, managing director at Knight Equity Markets in Jersey City, New Jersey.

There is a lot working against the market at this stage of the game. Now any gains are going to be hard fought and are going to really have to be justified. We are well past the easy sledding.

The Dow Jones industrial average <.DJI> rose 38.14 points, or 0.31 percent, at 12,208.02. The Standard & Poor's 500 Index <.SPX> was up 3.15 points, or 0.24 percent, at 1,324.30. The Nasdaq Composite Index <.IXIC> dipped 2.93 points, or 0.11 percent, at 2,781.74.

The S&P 500 has risen nearly 26 percent since the start of September, but recent trading volumes have been heavier on days the benchmark index has declined.

Jean-Claude Trichet said the latest oil spike heightened a warning he made on inflationary pressures in January, but added that so far the global economy was set for relatively robust growth.

(Reporting by Chuck Mikolajczak; editing by Jeffrey Benkoe)