After three consecutive days of losses, the S&P/TSX composite index managed to slide back into positive territory on Thursday, helped by rising oil prices that gave energy stocks a boost.

The index closed up 33.15 points on Thursday, or 0.26%, to 12,546.51.

Crude oil for November delivery rose US$2.29, or 2.2%, to close at US$108.02 a barrel on the New York Mercantile Exchange. This helped lift the TSX’s energy subindex by 1.53%.

Within the energy group, Canadian Natural Resources enjoyed a 2.43% gain, closing at $84.15, and Husky Energy shares rose 4.59% to finish at $47.40.

Companies in the financial group comprised a mixed bag of gains and losses. The group finished the day up 1.46%.

This included a small gain of 25¢ for Royal Bank of Canada shares, which closed at $51.50. The gain represented a rebound from losses earlier in the day caused by reports that the U.S. Securities and Exchange Commission was investigating the bank in connection to the collapse of the auction-rate securities market.

TD Bank Financial Group shares closed at $64.50, up $1.60, following rumours the bank is considering purchasing pieces of Washington Mutual Inc.

Gold futures fell, with the contract for December delivery sliding US$13 to finish the day at US$882 an ounce on the New York Mercantile Exchange.

This contributed to weakness among gold companies on the TSX, which dragged down the materials subindex by 3.55%.

Barrick Gold Corp. dropped $2.25 to close at $37.70 and Kinross Gold Corp. shares fell 5.23% to close at $17.05.

The gold subindex fell 4.47%.

The Canadian dollar briefly touched its highest point in more than seven weeks, helped by strong oil prices. It finished the day up US0.2¢ at US96.68¢.

The junior TSX venture index fell 9.96 points, or 0.64% to close at 1,540.68.

On Wall Street, stocks surged on news a tentative agreement had been reached on Capitol Hill to fund a major bailout of the financial sector.

The Dow Jones industrial average rose 196.89 points, or 1.8%, to end at 11,022.06. The Nasdaq composite index added 30.89 points, or 1.4%, to close at 2,186.57. The S&P 500 climbed 23.31 points, or 2%, to 1,209.18.