Best month in 37 years for the S&P

US stocks surged three per cent yesterday as an agreement by European leaders to help contain the region’s two-year debt crisis lifted a cloud hovering over markets.

Optimism that a deal would be struck to prevent widespread financial distress fueled the market’s rebound in October. The S&P 500 is up more than 13 per cent this month, on pace for its biggest monthly gain since October 1974.

But some traders said implementing the agreememt will present major challenges, observing that the devil is in the details.

After more than eight hours of talks, European heads of state, the International Monetary Fund and bankers sealed a deal that also foresees a recapitalization of hard-hit European lenders and a leveraging of the bloc’s rescue fund to give it firepower of $1.4 trillion.

The agreement includes provisions for write-downs on Greek bonds, though decisions on how to recapitalise hard-hit European banks and boost the EU’s rescue fund have not been finalised.

The Dow Jones industrial average was up 339.51 points, or 2.86 per cent, at 12,208.55. The Standard & Poor’s 500 Index was up 42.59 points, or 3.43 per cent, at 1,284.59. The Nasdaq Composite Index was up 87.96 points, or 3.32 per cent, at 2,738.63.

The day’s gains lifted the S&P 500 above its 200-day moving average for the first time since the beginning of August, a sign of an improving trend for stocks after five straight months of losses.

It was the strongest day for volume since 4 October, and the rise above the 200-day moving average may pull more long-term buyers into the market in coming days. About 11.22bn shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, well over last year’s daily average of 8.47bn.

Financials were the best performers, with JPMorgan Chase up 8.3 per cent and Citigroup jumping 9.7 percent. The KBW Bank index shot up six per cent while the S&P financial index soared 6.2 perc ent.

The CBOE Volatility index shed 14 per cent.

All 10 S&P sectors rose by more than one per cent. Materials and energy shares were among the top gainers as the resolution in Europe allayed fears about how weak growth might impact demand. Crude oil rose 4.3 percent.

Exxon Mobil rose one per cent after the Dow component’s results.