CIBC, Canada's fifth-largest bank, earned C$798 million (C$777 million), or C$1.91 per share, in the first quarter ended on January 31, down from C$835 million, or C$1.91 per share, a year earlier.

The settlement stems from an agreement to pay the estate of Lehman Brothers Holdings Inc to resolve litigation over a collateralized debt obligation tied to the bankruptcy of the former Wall Street Bank. CIBC agreed to the settlement in December.

Stripping out that charge and other smaller items, CIBC earned C$2.15 per share, up from C$1.97 a year earlier and ahead of analysts' expectations of C$2.08, according to Thomson Reuters I/B/E/S.

Retail banking income rose to C$611 million from C$567 million, helped by loan volumes that grew despite the bank's decision last year to wind down its FirstLine discount mortgage division and focus on higher-margin loans.

Canada's banks have been bracing for a sharp slowdown in retail banking growth due to a cooling housing market, more frugal borrowing trends among consumers, and low interest rates, which narrow the margins on loans.

CIBC has the smallest international exposure of Canada's "big five" banks, making it particularly vulnerable to a domestic lending slowdown.

Wholesale banking income, which includes trading, investment banking, and corporate lending, fell to C$91 million from C$133 million a year earlier, due to the settlement charge.

($1 = 1.0267 Canadian dollars)

(Reporting by Cameron French; Editing by Lisa Von Ahn)