Stocks eke out gains despite Iraq fears

Dow 4PM close

The worsening crisis in Iraq failed to spook Wall Street on Monday.

Stocks inched slightly higher on Monday as enthusiasm for a bonanza of M&A activity offset fears that the turmoil in the Middle East will cause energy prices to soar.

1. Iraq jitters continue: The Dow Jones industrial average and S&P 500 landed narrowly higher, while the Nasdaq rose 0.24% after a seesaw trading day that saw stocks alternate between green and red.

Related: CNNMoney's Fear & Greed Index still in 'extreme greed' mode

Stocks were helped by the fact that oil prices backed away from $107 a barrel despite concerns the fighting in Iraq could threaten the country's ability to export oil. Natural gas prices also fell almost 1% after bouncing around earlier. Investors will continue to monitor for signs of higher energy costs to Western consumers and businesses.

There are worries that images reportedly showing the mass execution of Iraqi soldiers could spawn an all-out sectarian civil war in the country. The White House said it is considering military options and may even work with Iran to help Baghdad fend off the terrorist threat.

"Last week's fast-paced developments in Iraq have the potential to turn into a serious threat for the bull market," Ed Yardeni, president of Yardeni Research, wrote in a note to clients. "My hunch is that the latest geopolitical crisis could set the market up for yet another relief rally."

Crisis in Iraq will hit you at the pump
Crisis in Iraq will hit you at the pump

Meanwhile, Russia said it has cut off supplies to Ukraine after negotiators failed to fix a payment dispute before a key deadline.

Related: Russia cuts off natural gas supplies to Ukraine

The geopolitical concerns helped drive European and Asian stock markets mostly lower on Monday.

2. Monday merger mania: Yet U.S. stocks were buoyed by the fact that cheap borrowing rates and tax policy continue to drive M&A (merger and acquisition) activity.

Medical device giant Medtronic (MDT) unveiled a $42.9 billion takeover Irish rival Covidien (COV). The deal is the latest "tax inversion" combination aimed at taking advantage of relatively low tax rates in some foreign countries by relocating corporate headquarters. Covidien soared over 20% on the news.

"Corporate America getting tired of waiting for comprehensive tax reform and choosing instead to move abroad $COV $MDT. Well good for them," wrote Stocktwits user flounder.

Related: Medtronic buys Covidien for $42.9 billion

There were also a number of smaller deals flying around.

Level 3 Communications (LVLT) agreed to scoop up business ethernet provider TW Telecom (TWTC) for $5.7 billion in cash and stock. TW stock jumped over 7% Monday.

Steven Spencer on Stocktwits wondered if there was something fishy about the trading of TW stock

"#SEC really needs to take a look at friday's trading activity in $TWTC. #insidertrading," he wrote.

Related: Boom time for mergers and acquisitions

Williams Cos. (WMB) spiked almost 19% as investors cheered the energy company's $6 billion deal to take full control of Access Midstream Partners (ACMP).

In the tech world, SanDisk (SNDK) inked a $1.21 billion buyout of smaller data-storage company Fusion-io (FIO), representing a 21% premium on its closing price on Friday.

3. Corporate movers -- Yahoo, Tesla & Goodyear: Yahoo (YHOO) retreated nearly 6% after Alibaba, the Chinese e-commerce giant it owns a chunk of, revealed new details of its planned initial public offering. The latest documents show Alibaba's revenue growth has slowed, though it was still up 39% year-over-year.

Related: Alibaba grows 39%, but is that good enough?

Bad news for Marissa Mayer?
Bad news for Marissa Mayer?

The big winner of the day was Tesla (TSLA). Shares cruised nearly 9% higher as the car maker said its long awaited Model X crossover vehicle should launch early next year.

Goodyear Tire (GT) revved about 4% after Barron's said the tire maker's stock could surge 50% within two years thanks to stronger demand.

4. Focusing on the economy: Home builders like Beazer (BZH) and Lennar (LEN) closed higher after an industry group said home builder sentiment has climbed to the highest level since January.

Manufacturing activity in the New York area gained momentum in June, a new report showed. The New York Fed's manufacturing index unexpectedly ticked up this month to 19.28 from 19.01.

Investors are also looking ahead to Wednesday's Federal Reserve decision. The central bank is expected to once again dial back its bond-buying program even as it dims its economic growth outlook.

Likewise, the International Monetary Fund trimmed its forecast for U.S. economic growth this year to 2% amid the struggling housing market. Despite the gloomier view, the IMF still expects the U.S. to grow 3% next year.

CNNMoney Sponsors