Stocks gained on Friday as General Electric Co's earnings bolstered views the recovery was gaining traction and helped set the market back on its up trend after two days of declines.

But Google pared its earlier gain, briefly turning negative and then edging back up again a day after the world's No. 1 search engine reported earnings that beat Wall Street's expectations. Google's pullback weighed on the Nasdaq.

Tempering some of the earnings optimism were results from Bank of America Corp , the latest bank to disappoint investors.

Shares of General Electric Co , considered a bellwether for corporate America, rose 5.6 percent to $19.46 and hit their highest level since April 30. The stock, the top positive on the Dow, also saw the biggest daily percentage jump since May 10.

GE reported stronger-than-expected earnings, helped by the recovery of its finance arm and a rise in revenue at its industrial units, including a sharp pickup in sales of locomotives.

That's just another sign of an improving economic situation, and improving corporate profits in America, as well as worldwide, said Bryant Evans, investment advisor and portfolio manager at Cozad Asset Management, in Champaign, Illinois.

Evans said stocks were also benefiting from the recent price declines, which have attracted more buyers.

There may be a certain kind of buying on the dips going on, he said.

The S&P 500 is up 9 percent since the start of December, but the index lost more than 1 percent over the past two days. Many technical and other analysts see the up trend continuing through the first half of the year.

Google Inc shares also gained 0.1 percent to $627.59, a day after the company reported better-than-expected net revenue for its fourth quarter. The company also had announced a shakeup in its executive suite. Earlier, Google rose to an intraday high of $641.73.

The Dow Jones industrial average <.DJI> was up 50.55 points, or 0.43 percent, at 11,873.35. The Standard & Poor's 500 Index <.SPX> was up 5.42 points, or 0.42 percent, at 1,285.68. The Nasdaq Composite Index <.IXIC> was up 2.58 points, or 0.10 percent, at 2,706.87.

Bank of America shares fell 1.1 percent to $14.38 after the largest U.S. bank by assets reported a second straight quarterly loss, driven by a $2 billion write-down in its mortgage business.

The results follow disappointing results earlier this week from Goldman Sachs and Wells Fargo , was up 1.3 percent, however.

(Reporting by Caroline Valetkevitch; Editing by Jan Paschal)