U.S. stocks got a boost from some bullish comments by uber-investor Warren Buffett over the weekend and a number of M&A deals. The stock market rose in February, marking the third consecutive month of equity price gains.

However, trading volume was relatively modest and continued unrest in the Middle East (and their effect on oil prices) will probably continue hover like a dark cloud over market sentiment.

The Dow Jones Industrial Average rose 95.89 points, or 0.79 percent, at 12,226.34. The S&P 500 Index climbed 7.35 points, or 0.56 percent, at 1,327.23. The Nasdaq Composite Index edged up 1.22 points, or 0.04 percent, at 2,782.27.

For the whole month of February, the Dow rose 2.8 percent, the S&P added 3.2 percent and the Nasdaq climbed 3 percent.

Buffett, chairman of Berkshire Hathaway Inc (NYSE:BRK.A) wrote in his annual letter to stockholders of the need for making some major acquisitions,” suggesting stock prices might be attractive.

Investors also likely got some reassurance from comments by some Federal Reserve officials.

St. Louis Fed Bank President James Bullard said he would not rule out further use of the Fed's bond-buying program to provide stimulus to the economy.

Ventas Inc (NYSE:VTR) said it plans to purchase Nationwide Health Properties (NYSE:NHP) for $5.8 billion in stock.

NHP shares surged by 9.7 percent.

Nasdaq gains were dampened by Amazon.com Inc (Nasdaq:AMZN) which dropped 2.23 percent after a brokerage downgrade.

Oil prices in New York dropped more than 1 percent to $96.96 per barrel.

Bonds climbed as the yield on the 10-Year Treasury slipped to 3.41 percent.