TORONTO (Reuters) - Canada's main stock index had its biggest one-day gain in more than two months on Thursday, with energy shares rallying as OPEC members extended output cuts and Canadian Imperial Bank of Commerce (>> Canadian Imperial Bank of Commerce) rising after forecast-busting earnings.

* The Toronto Stock Exchange's S&P/TSX composite index <.GSPTSE> ended up 99.76 points, or 0.62 percent, at 16,067.48. Seven of its 10 main groups finished higher, with advancers outnumbering decliners by a 4.5-to-1 ratio.

* The energy group climbed 2.2 percent, with crude prices boosted by a deal among OPEC members and other oil producers to extend output cuts until the end of 2018.

* Pipeline operator Enbridge Inc (>> Enbridge Inc) jumped 6.3 percent to C$48.65 after saying it plans to sell C$3 billion of assets.

* Toronto-Dominion Bank (>> Toronto-Dominion Bank), the country's second-biggest bank, lost 2.4 percent to C$73.24 as lower investment banking revenue contributed to a fourth-quarter earnings miss, while No. 5 lender Canadian Imperial Bank of Commerce (>> Canadian Imperial Bank of Commerce) rose 2.9 percent to C$118.14 after its earnings exceeded expectations.

* Lundin Mining Corp (>> Lundin Mining Corporation) slumped 16.1 percent to C$7.52 in heavy volume after the diversified base metals miner lowered production guidance for 2018 at a flagship copper mine and several analysts cut their recommendations and target prices on the stock.

* The materials group, which includes precious and base metals miners and fertilizer companies, lost 0.3 percent.

(Reporting by Alastair Sharp; Editing by Meredith Mazzilli and Marguerita Choy)

By Alastair Sharp