Energy stocks pushed indexes higher after Exxon-Mobil reported its most profitable quarter since 2008.
Massey Energy jumped 10% after Alpha Natural Resources said it would buy the coal producer in a $7.1 billion deal.
Concerns over the growing unrest in Egypt sent crude oil prices up 3% to $92 a barrel.
At the market close, the Dow Jones industrial average was up 68 points, or 0.6%, to 11,892. The broader S&P 500 index was up 10, or 0.8%, to 1,286. The Nasdaq composite index was up 13, or 0.5%, to 2,700.
Two stocks rose for every one that fell on the New York Stock Exchange. Volume came to 1.2 billion shares.