The Treasury Department said Tuesday it has recovered the $1.7 billion in bailout funds it put into Milwaukee-based bank Marshall & Ilsley Corp.

In December, BMO Financial Group said it was buying Wisconsin's largest bank for $4.1 billion in stock. With the acquisition, BMO agreed to repay the Troubled Asset Relief Program funds.

As part of the deal's closing Tuesday, Toronto-based BMO bought $1.7 billion in Marshall & Ilsley preferred shares from the Treasury Department. The department said BMO also paid $3.3 million for warrants for additional shares, and paid accrued dividends totaling $11.9 million.

Treasury said it turned a $229 million profit on the TARP funds invested in Marshall & Ilsley.

Marshall & Ilsley, with more than 190 offices throughout Wisconsin and other Midwestern states, will be renamed BMO Harris Bank, after BMO combines it with the Chicago-based Harris Bank it already owned. The combination is expected to take about 18 months.

Canadian banks weathered the financial crisis much better than their counterparts in the U.S. and elsewhere. BMO's acquisition of Marshall & Ilsley was seen as another instance of a Canadian bank snapping up a U.S. financial institution battered by the crisis.

BMO is the parent company of the Bank of Montreal. Its U.S.-traded shares closed Tuesday trading down $1.19 at $63.15.