U.S. stocks rallied on Friday after results at Google Inc. and Caterpillar Inc. were above analyst' expectations and investors were relived Citigroup Inc.'s writedowns were not as bad as expected.

Banking giant Citigroup, gained to its highest level since February after its $5.11 billion loss was less than the most pessimistic estimates. Google, owner of the most popular search engine, reported its best gain in 4 years on strong overseas growth. Caterpillar, the largest maker of bulldozers, climbed the most in a month on profit that was helped by higher sales in China and India.

The S&P 500 added 23.34, or 1.7 percent, to 1,388.90 at 11.35 a.m. in New York. The Dow Jones Industrial Average rallied 212.10, or 1.7 percent, to 12,832.59. The Nasdaq Composite Index increased 59.51, or 2.5 percent, to 2,401.34.

Citigroup, the largest U.S. bank by assets, posted a first-quarter loss of $1.02 a share, worse than the loss of 95 cents expected by analysts, but revenue exceeded expectations. The company also took write-downs and other losses which totaled about $12 billion and vowed to continue divest non-core assets.

Google shares rose 19 percent after the Internet giant posted a 31 percent rise in first-quarter profit to $1.31 billion late Thursday and said growth in paid clicks in its popular advertising program, was higher than previously expected.

Caterpillar Inc. rose $4.82 to $83.41. First-quarter earnings rose 13 percent and first-quarter profit was$1.45 a share which beat analysts' estimates. The company citied stronger demand from China and India.

In overseas markets, European shares advanced, while Asia's benchmark index retreated. Overnight, Japan's Nikkei 225 Average ended 0.6 percent higher Friday.