(c) 2014, Bloomberg News.

(c) 2014, Bloomberg News.

NEW YORK U.S. stocks rose, with the Standard & Poor's 500 Index erasing an earlier slide, as Internet and smaller companies pulled back from a selloff amid optimism over merger activity.

Pfizer added 4.2 percent after proposing to buy AstraZeneca for about 58.8 billion pounds ($98.7 billion). Microsoft and Apple rallied more than 2.4 percent, leading gains among the largest technology companies. Bank of America dropped 6.3 percent after suspending its planned buybacks and dividend increase because of an error in its capital planning.

The S&P 500 rose 0.3 percent to 1,869.43 at 4 p.m. in New York, reversing an earlier loss of 0.7 percent. The Dow Jones Industrial Average increased 87.28 points, or 0.5 percent, to 16,448.74. The Nasdaq Composite Index declined less than 0.1 percent after tumbling as much as 1.5 percent, and the Russell 2000 Index of smaller companies slid 0.5 percent. About 7.5 billion shares changed hands on U.S. exchanges, 9.3 percent above the three-month average.

"It's remarkable how volatile the market can be on an intraday basis," John Carey, a Boston-based fund manager at Pioneer Investment Management, which oversees $220 billion worldwide, said by phone. "Most of the companies that have reported so far have exceeded expectations and there's M&A that's bubbling along and that could be causing some optimism, with big deals and restructuring."

U.S. equities began higher as large companies rallied on optimism about merger activity. Stocks turned lower as the U.S. and European Union imposed new sanctions on Russia, while selling in Internet and small-cap stocks spread to the broader market. Major indexes recovered in the afternoon, turning positive during the final hour of trading.

The Nasdaq Composite declined 0.5 percent last week, including a 1.8 percent tumble on Friday, as disappointing results from Amazon.com triggered a selloff in technology shares and tensions over Ukraine intensified. The technology- heavy gauge has fallen in four of the past five weeks amid concern valuations have outpaced estimates for earnings growth. Nasdaq companies trade at 34 times reported earnings, about double the level of S&P 500 members.

The frequency of selloffs has increased even as technology makers are forecast to post the second-fastest profit growth in the S&P 500 this year and members of the Nasdaq 100 Index are beating analyst estimates by almost 10 percent this earnings season.

Increases among larger stocks helped push technology companies in the S&P 500 higher as a group. Microsoft surged 2.4 percent to $40.87 and Apple climbed 3.9 percent to $594.09 to extend its three-day rally to 13 percent, the most since 2009. IBM added 1.9 percent to $193.14.

The Dow Jones Internet Index fell 1.9 percent, extending a 4.1 percent decline on Friday. The index has dropped 18 percent from a 13-year high on March 5. Only four of 41 members in the gauge rose on Monday. Yahoo dropped 1.4 percent to $33.99. Amazon slumped 2.4 percent to $296.58. Netflix tumbled 2.4 percent to $314.21.

A report by the National Association of Realtors showed contracts to purchase previously owned U.S. homes climbed in March by the most in almost three years, showing residential real estate was starting to stabilize entering the spring selling season. The pending home sales index rose 3.4 percent, the first gain in nine months, after a 0.5 percent drop in February that was smaller than initially reported.

A busy calendar this week will give investors more clues about the strength of the economy and the pace of the Federal Reserve's stimulus program.

The government's initial tally of first-quarter gross domestic product on Wednesday may show the slowest expansion in a year. Federal Reserve policy makers, who on the same day conclude their third meeting of the year, will probably reduce the pace of assets purchases designed to stoke the economy.

Three rounds of monetary stimulus have helped fuel economic growth, sending the S&P 500 surging as much as 180 percent from its 2009 low.

Payroll growth probably accelerated in April as companies remained upbeat about the economy's prospects after a setback in demand caused by snowstorms and colder temperatures earlier this year. Employers added 215,000 workers, the most since November, economists project a report from the Labor Department on Friday will show.

Investors are also watching developments in Ukraine. The Obama administration imposed sanctions on seven Russian officials and 17 companies linked to Russian President Vladimir Putin's inner circle involved in banking, energy and infrastructure.

The sanctions, announced by the White House on Monday, are being imposed in conjunction with the European Union, which said on Monday it is adding 15 names to its list of previously sanctioned individuals.

The Chicago Board Options Exchange Volatility Index, a gauge of options prices on the S&P 500, dropped 0.6 percent for its first loss in four days. The gauge jumped 5.6 percent on April 25.

Consumer-staples and phone companies had the biggest gains among 10 groups in the S&P 500, climbing more than 1.1 percent. Financial and raw-materials shares declined the most, dropping at least 0.5 percent.

Pfizer added 4.2 percent to $32.04. The world's largest drugmaker is still interested in a deal after AstraZeneca spurned its earlier offer. Pfizer proposed buying the London- based company on Jan. 5 for 46.61 pounds a share in cash and stock, and AstraZeneca declined to pursue negotiations, the New York-based company said in a statement on Monday. The bid was about 14 percent above AstraZeneca's closing price on Friday.

General Electric gained 0.7 percent to $26.78 after Chief Executive Officer Jeffrey Immelt met with France's President Francois Hollande over the company's offer for Alstom. Immelt may be moving closer to pulling off his largest-ever acquisition, even after French officials over the weekend urged Alstom to consider a rival offer from Germany's Siemens.

The government doesn't oppose GE's proposal, and the meeting in Paris on Monday focused on protecting jobs and maintaining the independence of France's nuclear industry, according to a person with knowledge of the discussions. The state doesn't favor either bid, the person said, asking not to be named as the talks weren't public.

NorthStar Realty Finance soared 7.3 percent to a record $17.20. American Realty Capital Properties, the largest owner of single-tenant U.S. buildings, is interested in acquiring NorthStar for about $20 a share, according to a person with knowledge of the matter. That's a premium of 25 percent to NorthStar's closing price of $16.03 last week and would value the New York-based company at about $6.5 billion. American Realty fell 3 percent to $12.62.

Newmont Mining dropped 6.7 percent to $24.67. Barrick Gold said Newmont ended discussions about a takeover, which would have combined the world's two largest gold producers. Talks between Newmont and Toronto-based Barrick broke down on April 18 over a disagreement about a proposed spinoff of some of the combined company's assets, people familiar with the situation said the following day.

Bank of America lost 6.3 percent to $14.95. The bank said it will suspend its planned buybacks and dividend increase because of an error in its capital planning. The lender will resubmit its proposal to the Federal Reserve, the Charlotte, N.C.-based bank said in a statement. The company said it incorrectly adjusted for cumulative realized losses on structured notes issued by Merrill Lynch.


With assistance from Lu Wang in New York and Inyoung Hwang in London