Encouraging U.S. economic data and a batch of corporate deals put investors in a buying mood Monday, sending stocks sharply higher.
The broad rally nudged the Dow Jones industrial average back into positive territory for the year after a rough stretch for the market most of last week.
Traders welcomed a government report showing that consumer spending and incomes rose in February. Another report hinted at a strong start to the spring buying season.
Energy stocks were among the biggest gainers, bucking a slide in the price of crude oil. Several drugmakers soared on merger news.
"You had all the elements today for a positive market," said Quincy Krosby, market strategist for Prudential Financial.
The Dow rose 263.65 points, or 1.5 percent, to 17,976.31. The 30-company index was up as much as 295 points. It's now up 0.9 percent for the year.
The Standard & Poor's 500 index rose 25.22 points, or 1.2 percent, to 2,086.24, while the Nasdaq composite gained 56.22 points, or 1.2 percent, to 4,947.44. Both indexes are also up for the year.
Investors have their eye on economic data as they look ahead to the next round of corporate earnings, beginning next week. While a clutch of weaker-than-expected data sent the market lower much of last week, positive economic news got Monday's rally going early.
In Europe, a survey from the European Commission showed economic sentiment across the 19-country eurozone was at its highest level since July 2011. In Asia, Chinese stocks soared on hopes of more economic stimulus.
In the U.S., the government said that consumer spending edged up 0.1 percent in February following two straight monthly declines, while consumers' incomes rose a solid 0.4 percent. The National Association of Realtors reported that its index of pending home sales rose to its highest level since June 2013.
"Today's data suggest that the economy is going to be stronger in the next quarter starting in April," Krosby said.
Expectations that any increase in the Federal Reserve's key interest rate this year will be gradual also helped lift the market. On Friday, Federal Reserve Chair Janet Yellen said in a speech that continued improvement in the U.S. economy means an increase in the Fed's key interest rate could come later this year, but would likely be gradual.
"The market takes some confidence in that," said Erik Davidson, chief investment officer for Wells Fargo Private Bank.
All told, the 10 sectors in the S&P 500 rose, with energy stocks notching the biggest gain. The sector rose 2.1 percent. It's still down 2.7 percent for the year. Analog Devices led all stocks in the S&P 500, climbing $5.97, or 10.2 percent, to $64.81.
Investors bid up several health care companies and drugmakers involved in deals.
UnitedHealth Group jumped 2.5 percent after the insurer agreed to buy pharmacy benefits manager Catamaran. Shares in UnitedHealth Group added $2.99 to $121. Catamaran vaulted 23.8 percent, adding $11.51 to $59.83.
Auspex Pharmaceuticals soared 41.5 percent after it agreed to be acquired by Teva Pharmaceuticals Industries for about $3.2 billion in cash. Auspex gained $29.45 to $100.36.
Horizon Pharma climbed 18.2 percent on news it is buying Hyperion Therapeutics for $1.1 billion. Horizon gained $3.97 to $25.78. Hyperion added $3.24, or 7.6 percent, to $45.98.
The price of oil fell slightly ahead of Tuesday's deadline for negotiators to reach a general agreement to curb Iran's nuclear program in exchange for an easing of sanctions.
If it appears that more Iranian crude could eventually come on the market, prices could fall. U.S. oil fell 19 cents to $48.68 a barrel. Brent crude, a benchmark for many international oils imported by U.S. refineries, slipped 12 cents to $56.29 a barrel.
In other futures trading:
— Wholesale gasoline was unchanged at $1.80 a gallon
— Heating oil was unchanged at $1.73 a gallon
— Natural gas rose 0.5 cent to $2.644 per 1,000 cubic feet
Precious and industrial metals futures closed mixed. Gold fell $15 to $1,184.80 an ounce, silver fell 40 cents to $16.67 an ounce and copper edged up a penny to $2.78 a pound.
U.S. government bond prices rose. The yield on the 10-year Treasury note edged down to 1.96 percent from 1.97 percent late Friday.