U.S. stocks rallied on Monday after three straight days of losses as several mergers lifted investor confidence.

An uptick in mergers and acquisitions is considered a bullish sign as it suggests companies are more optimistic about the economy and see values in the market.

A number of companies announced large takeover deals. Xerox agreed to buy Affiliated Computer Services Inc for $6.4 billion while Covidien said it would buy Aspect Medical for about $210 million.

Affiliated shares climbed 14 percent to $53.92 while Aspect soared 55 percent to $11.90.

With Monday's gains, the Dow Jones industrial average is up nearly 16 percent in the quarter so far, which would make it its best such period since the fourth quarter of 1998.

Abbott Laboratories gained 3.1 percent to $48.80 after it said it would pay $6.6 billion for the drugs unit of Solvay . The purchase gives Abbott full control of its Belgian development partner's cholesterol treatments and exposure to emerging markets.

Its encouraging that companies are taking these actions, even if it is in an environment of cheap money, said Joseph Battipaglia, market strategist at Stifel Nicolaus in Yardley, Pennsylvania.

Plus, we had some pretty solid moves to the downside last week, so it doesn't surprise me that we're getting a bounce today.

A Jewish holiday observed Monday and the end of the third quarter two days later could translate into thin volume and volatility as fund managers reposition their assets amid fewer market participants, investors said.

The Dow Jones industrial average <.DJI> gained 128.33 points, or 1.33 percent, to 9,793.52. The Standard & Poor's 500 Index <.SPX> rose 17.06 points, or 1.63 percent, to 1,061.44. The Nasdaq Composite Index <.IXIC> climbed 42.38 points, or 2.03 percent, to 2,133.30.

The Dutch biotechnology firm Crucell said Johnson & Johnson bought 14.6 million new Crucell shares for over $400 million as part of a flu vaccine development deal.

Crucell shares fell 5.6 percent to $22.37 on the Nasdaq.

China Unicom <0762.HK> said it would sell Apple Inc's iPhone in China, starting in October. [ID:nHKG249644] France Telecom's Orange also said it would sell the product later this year.

Shares of Apple rose 1.9 percent to $185.80.

Gander Mountain shares surged 35 percent to $5.16 after it said it intends to go private. Under the terms of the deal, two of Gander's largest shareholders will buy out stakes held by the remaining holders.

The Federal Reserve Bank of Chicago said its National Activity Index was minus 0.9 in August, but its three-month moving average of economic indicators improved for the seventh straight month, rising to its highest level since June 2008.

(Editing by Padraic Cassidy)