Northeast Bank has closed on a $29 million transaction that will net it $16 million in new capital, the bank said Wednesday.

As part of the deal, the specially formed FHB Formation investment group will inject $16 million of new capital into the Lewiston-based bank and buy a $13 million, or 60 percent, stake in the institution.

The bank’s headquarters will remain in Lewiston, but two new lines of business — an online service that allows bank customers to direct funds to charities and a venture that will have Northeast buy loans from across the country and service them — will be based largely in Boston.