Stocks rose on Friday after strong earnings from Google and Citigroup helped lift some of the angst about Europe's debt crisis and stalled U.S. budget talks.

Two large merger offers also helped. BHP Billiton's $12 billion offer to purchase Petrohawk lifted shares in the energy sector, and investor Carl Icahn's offer to buy Clorox Co for $10.2 billion pushed those shares 8.2 percent higher.

Google Inc's earnings beat the most bullish forecasts, sending its shares up 12 percent. Citigroup Inc posted higher net income, helped by falling credit losses, which helped lift the stock 2.5 percent.

This is good news for Citi and good news for the market, said Timothy Ghriskey, co-founder of the Solaris Group. Very good numbers here, primarily on lower credit costs.

The Dow Jones industrial average <.DJI> gained 58.12 points, or 0.47 percent, to 12,495.24. The Standard & Poor's 500 Index <.SPX> rose 7.87 points, or 0.60 percent, to 1,316.74. The Nasdaq Composite Index <.IXIC> added 26.45 points, or 0.96 percent, to 2,789.12.

BHP Billiton's bid for Petrohawk, which jumped 64 percent, drove up shares in the energy sector as investors speculated more deals ahead. Chesapeake Energy rose 5.2 percent to $31.79, while the Select Sector Energy Select Sector SPDR exchange traded fund rose 1.3 percent to $75.80.

Europe's sovereign debt crisis, stalled budget talks in Washington and an uncertain economic backdrop have sent stocks on a roller coaster ride since the spring. The market could be in for more of that volatility on Friday afternoon.

A health check of European banks is expected to show later on Friday that as many as 15 lenders need more capital to withstand a prolonged recession, with criticism growing that the tests do not encompass the impact of a Greek default.

As deadlock in Washington's budget talks sets in, ratings agency Standard & Poor's warned there was a 1-in-2 chance it could cut the United States' top rating if a deal to raise the government debt ceiling is not reached soon.

(Additional reporting by Angela Moon; Editing by Padraic Cassidy)