Toronto stocks surged on Wednesday, after a week-long slide, in a broad rally led by resource and banking shares.

The S&P/TSX composite index jumped 350.39 points, or 2.88%, to finish at 12,497.15, after falling almost 500 points yesterday.

All 10 of the TSX main groups advanced Wednesday.

Leading the way, energy shares rose 4% as OPEC said it would cut production, which was seen as an attempt to halt a recent sharp slide in the price of oil.

EnCana was up 3.1% at $69.18.

The resource-laden materials group rose 3.9%. Fertilizer producer Potash Corp of Saskatchewan gained 2.2% to $153.59.

The financials group rose 2.5% on continued optimism over the U.S. mortgage company bailout plan. Bank of Montreal climbed 1.6% to $48.56 and Bank of Nova Scotia was up 1.7% at $47.63.

Today’s optimism didn’t spill over to small-cap stocks. The junior S&P/TSX Venture composite index fell 24.53 points, or 1.51%, to end at 1,596.73.

The Canadian dollar edged up 0.07 of cent to close at US93.48¢.

In New York, U.S. stocks rose as OPEC’s move to shore up oil prices boosted energy shares and Texas Instruments’ outlook soothed fear about technology spending.

Financial shares, however, were broadly lower after Lehman Brothers posted an unexpectedly large quarterly loss on huge mortgage-related write-downs and failed to announce any firm deals to raise desperately needed capital.

The Dow Jones industrial average was up 38.19 points, or 0.34%, at 11,268.92. The S&P 500 was up 7.53 points, or 0.61%, at 1,232.04. The Nasdaq composite index was up 18.89 points, or 0.85%, at 2,228.70.