Stocks surged, almost erasing the 2011 loss in the Standard & Poor’s 500 Index, as Europe made progress in debt-crisis talks, Caterpillar Inc.’s earnings beat forecasts and takeovers lifted health-insurance and software companies. Commodities rose on signs of Asian growth. The S&P 500 advanced 1.3 percent to 1,254.19 at 4 p.m. in New York as Caterpillar rallied 5 percent. Healthspring Inc. and RightNow Technologies Inc. surged at least 19 percent after agreeing to be bought. Industrial metals jumped the most in three years in London and oil climbed to a two-month high above $91 a barrel. The euro added 0.2 percent, reversing an earlier loss. Treasuries fell.