The S&P 500 <.SPX>, which rose as much as 1.27 percent earlier in the day, ended just 0.54 percent higher. But the gains followed the S&P's rally of 12.6 percent in the first six months of 2013. That marked the strongest first half of the year since 1998 for the benchmark S&P 500.

"We've had a couple days of pretty good moves, and on Friday and today, you've had some intraday profit-taking," said Rick Meckler, president of hedge fund, LibertyView Capital Management LLC, in Jersey City, New Jersey.

Wall Street has been showing signs of stabilization in the past week after a selloff that was triggered by concerns that the Federal Reserve's bond-buying policy, which has partly fueled this year's rally in equities, would end sooner than expected. June was the S&P 500's first negative month since October.

"Certainly people who were caught in the downdraft had a chance to buy either down there (when markets sold off) or recover and lighten up a little bit," Meckler said.

Among the S&P 500's 10 industrial sectors, the telecom and utilities sectors were the decliners of the day. The S&P telecom sector index <.SPLRCL> slipped 0.1 percent. The S&P utilities sector index <.SPLRCU> lost 1.3 percent.

The day's early rally was bolstered by data from the Institute for Supply Management that showed U.S. manufacturing activity grew in June, rebounding from an unexpected contraction in May. Construction spending neared a four-year high in May, according to the Commerce Department.

The Dow Jones industrial average <.DJI> rose 65.36 points, or 0.44 percent, to end at 14,974.96. The Standard & Poor's 500 Index <.SPX> advanced 8.68 points, or 0.54 percent, to finish at 1,614.96. The Nasdaq Composite Index <.IXIC> gained 31.24 points, or 0.92 percent, to close at 3,434.49.

The S&P's best-performing sectors included non-cyclical consumer goods and services, industrials and technology. Shares of Procter & Gamble (>> The Procter & Gamble Company), the world's largest household products maker, rose 1.3 percent to $78.02.

The S&P financial index <.SPSY> gained 0.5 percent. Citigroup (>> Citigroup Inc) shares rose 0.6 percent to $48.25 after the bank said it agreed to pay $968 million to settle claims that it left U.S.-owned mortgage guarantor Fannie Mae (>> Federal National Mortgage Association) on the hook for home loans the agency would not have knowingly guaranteed.

Netflix (>> Netflix, Inc.), up 6.3 percent at $224.28, and Apple (>> Apple Inc.), up 3.2 percent at $409.22, helped lift the Nasdaq. There was no obvious catalyst for the rally in Netflix shares although the company announced an exclusive multi-year streaming deal to provide "New Girl," a hit comedy on Fox, to its U.S. customers. Earlier on Monday, Raymond James raised its recommendation on Apple's stock to "strong buy" from "outperform."

MORE VOLATILITY AHEAD

While investor fears that the Fed may take an early exit from its stimulus efforts have faded for now, analysts say the eventual transition to a no-stimulus environment is expected to result in more volatility.

"I still believe the market is trying to figure out how to price in slightly higher interest rates, even if rate increases from the Federal Reserve are still at least a year away," said Randy Frederick, managing director of active trading and derivatives at the Schwab Center for Financial Research in Austin, Texas.

Frederick added that since the monthly nonfarm payrolls data will coincide with the weekly jobless claims report this week, investors should "be prepared for a volatile move an hour before market open" on Friday.

In corporate news, Jefferies & Co raised its price target on Tesla Motors' (>> Tesla Motors Inc) stock to $130 from $70, saying the electric car maker was on track to deliver 21,000 Model S cars in 2013. Tesla's stock shot up 9.2 percent to $117.18.

Onyx Pharmaceuticals Inc (>> Onyx Pharmaceuticals, Inc.) surged 51.3 percent to $131.33 after the company said it was considering selling itself, though it had rejected a roughly $10 billion bid from Amgen Inc (>> Amgen, Inc.). Canaccord Genuity raised its price target on the stock to $140 from $105.

In other pharmaceutical-related news, Insmed Inc (>> Insmed Incorporated) tumbled 18.7 percent to $9.72 after its experimental lung infection drug fared no better than a competing one developed by Novartis AG (>> Novartis AG) in a lung function test.

Shares of games publisher Zynga Inc (>> Zynga Inc) soared after a report by AllThingsD that the company could replace its Chief Executive Mark Pincus with Microsoft Corp (>> Microsoft Corporation) executive Don Mattrick, possibly as early as late Monday. Zynga shares jumped 10.4 percent to $3.07.

Zynga said after the closing bell that Mattrick, who heads Microsoft's Xbox business, has been appointed to replace Pincus as CEO, effective July 8.

About 6 billion shares exchanged hands on the New York Stock Exchange, the Nasdaq and NYSE MKT, slightly below the daily average so far this year of about 6.4 billion.

Advancing issues outpaced decliners by a ratio of about 7 to 3 on the NYSE. On the Nasdaq, about 18 stocks rose for every seven that fell.

(Editing by Jan Paschal)

By Angela Moon