Stocks rallied on Monday, snapping a three-day losing streak, as a spurt of corporate takeovers in the technology and health-care sectors fueled optimism about share values.

Mergers and acquisitions are typically viewed as bullish as it suggests companies are more optimistic about the business outlook.

A number of deals were announced and investors bet more could follow. Xerox Corp agreed to buy Affiliated Computer Services Inc , and Abbott Laboratories said it would pay $6.6 billion for Solvay's drug unit.

It's always a positive sign when you see companies putting money to work, whether they buy other companies, invest in new plants, (or) buy back their own stock, said Tim Smalls, head of U.S. stock trading at brokerage firm Execution LLC in Greenwich, Connecticut.

With depressed stock prices, like we've had over the past year and a half, a lot of companies will find it cheaper to buy a company than to grow that same type of company organically. It's a more effective way to put money to work sometimes.

The Dow Jones industrial average <.DJI> rose 124.17 points, or 1.28 percent, to end at 9,789.36. The Standard & Poor's 500 Index <.SPX> gained 18.60 points, or 1.78 percent, to 1,062.98. The Nasdaq Composite Index <.IXIC> shot up 39.82 points, or 1.90 percent, to 2,130.74.

With Monday's gains, the Dow Jones industrial average held an advance of about 16 percent in the quarter so far, which would make it the index's best such period since the fourth quarter of 1998.

But the end of the third quarter on Wednesday may spur volatility as fund managers engage in what is known as window dressing -- when they sell laggards in favor of outperformers to spruce up portfolios at quarter's end.

In the last three sessions, the S&P 500 had declined more than 2 percent after rallying nearly 60 percent from the 12-year closing low of early March.

MERGER MONDAY

Abbott climbed 2.6 percent to $48.58, while Affiliated Computer advanced 14 percent to $53.86.

Xerox, which valued the cash-and-stock deal for Affiliated at an initial $6.4 billion, sank 14.5 percent to $7.68.

Other deals on Monday included U.S. diversified health-care company Johnson & Johnson's purchase of an 18 percent stake in biotech firm Crucell for 302 million euros ($444 million) as part of a flu vaccine development deal, the Dutch company said on Monday.

The pharmaceuticals index <.DRG> climbed 1.3 percent.

Crucell fell 6.6 percent to $22.13 on Nasdaq, but J&J, a Dow component, was up 1.1 percent at $61.27 on the New York Stock Exchange.

Apple Inc rose 2.1 percent to $186.15 after China Unicom <0762.HK> said it would sell Apple's iPhone in China, starting in October. France Telecom's Orange also said it would sell the product later this year. Apple provided the Nasdaq's top boost, followed by chip maker Qualcomm Inc , up 2.8 percent at $45.97. The semiconductor index <.SOXX> was up 2.1 percent.

Cisco Systems Inc gained 4.4 percent to $23.61 after Barclays Capital raised its rating on the network equipment maker, citing improving demand.

Dow Chemical Co rose nearly 5 percent to $26.39 after U.S. antitrust regulators cleared Dow's $1.68 billion sale of Morton Salt to Germany's K+S AG.

Other industrial standouts were U.S. aircraft manufacturer and defense contractor Boeing Co , up 3 percent at $53.07, and diversified manufacturer 3M Co , up 1.6 percent at $75.01.

The Jewish holiday of Yom Kippur observed on Monday kept volume lighter, with only about 979.3 million shares changing hands on the New York Stock Exchange, compared with last year's estimated daily average of 1.49 billion. On the Nasdaq, about 1.92 billion shares traded, below last year's daily average of 2.28 billion.

Advancing stocks outnumbered declining ones by a ratio of about 4 to 1 on the NYSE, while on Nasdaq, about 10 stocks rose for every seven that fell.

(Editing by Jan Paschal)