NEW YORK -- Stocks finished with slim gains Monday, recovering from the worst week of the year, as technology and energy stocks lifted the broader market.
The Dow Jones industrial average rose 0.1%, the S&P 500 edged up 0.5% and the tech-heavy Nasdaq gained 0.9%.
Apple, Dell and other M&A news: Shares of Apple, which have been in freefall lately, closed slightly lower, hitting another new 52-week low.
Among tech shares, Microsoft was a big gainer. Shares rose almost 4% to a seven-month high after ValueAct CEO Jeffrey Ubben confirmed to CNNMoney that the hedge fund planned to take a nearly $2 billion stake in the company, making it one of Microsoft's biggest shareholders. CNBC had earlier reported ValueAct's plans.
Netflix shares rallied almost 7%, making it the biggest winner in the S&P 500 and Nasdaq 100. Shares continued to rally in after-hours trading after the company trounced earnings expectations on more than $1 billion in revenue, a sign that its orignal "House of Cards" video series is paying off.
Energy giant Halliburton shares jumped almost 6% after it handily beat earnings and revenue estimates.
Caterpillar shares climbed almost 3% after the company announced that it plans to buy back shares for the first time since 2008. That plan overshadowed Caterpillar's worse-than-expected profit and revenue, as well as its weak outlook for the year.
Analysts expect earnings for S&P 500 companies to rise by 2% for the first quarter, according to S&P Capital IQ. But earnings season is far from over. So far, 107 S&P 500 companies have reported, with 72 beating forecasts, 24 missing and 11 coming in in line.
Aside from earnings, shares of Power One Inc. surged more than 50% after Swiss company ABB greed to buy the solar power company in a $1 billion deal.
On the downside, General Electric shares dropped nearly 2% after JPMorgan Chase downgraded the stock to neutral.
Earlier in the day, stocks were mixed as as investors reacted to a lackluster report on the housing market. An industry report showed that existing home sales slipped 0.6% in March from the prior month. Analysts expected the sales rate to rise.
Gold was also back in the spotlight. After last week's rout, the precious metal was up almost 2%, to $1,421.20 an ounce. That helped push the SPDR Gold Shares Trust ETF up almost 2%, and shares of gold miner Randgold spiked nearly 5%.
European markets finished little changed, amid hopes that Italy may soon have a new government after President Giorgio Napolitano was elected for a second term. Asian markets ended mixed, with the Shanghai Composite declining 0.1% and the Hang Seng adding 0.1%.
Japan's Nikkei rose 1.9% and the yen fell to almost 100 against the U.S. dollar after the G-20 gave its blessing to Japan's new monetary policy experiment.
The dollar fell against the euro, the British pound and the Japanese yen.
Oil prices edged slightly higher.
The price on the 10-year Treasury edged up, pushing the yield down to 1.69% from 1.70% late Friday.
-- CNNMoney's Maureen Farrell contributed