An investor group led by Barclays has agreed to buy two mortgage books from defunct bank Bradford & Bingley for £5.3 billion.

The closed books had been managed UK Asset Resolution (UKAR), the so-called bad bank that looked after assets of Bradford & Bingley and Northern Rock after their collapse and nationalisation in 2008.

The deal will effectively recover £5.3 billion of taxpayer cash, according to the Treasury.

The consortium, led by Barclays, intends to securitise the residential loan portfolio - meaning it will be made available as an investment product after the sale is completed.

The loans were purchased with equity funding from funds managed by Pimco.

Art Mbanefo, head of financing resources management at Barclays, said: "This transaction is a strong example of our commitment to offer our balance sheet, our advisory expertise and our excellence in structuring and execution to create shared value for our clients.

"We are proud to be working with UKAR in helping maximise value for the UK taxpayer."

UKAR said a key consideration in choosing the successful bidder of the mortgage books was the "continued fair treatment of customers" and assurance that there will be no changes to the terms and conditions of the loans as a result of the transaction.

The mortgages will continue to be administered by the same company to provide continuity of service, though customers whose mortgages are included in the deal will be contacted to explain the change of ownership.

UKAR chief executive Ian Hares said: "This marks a significant moment in B&B's history with all £15.65 billion returned to the FSCS and ultimately the taxpayer.

"When complete, this sale will reduce UKAR's balance sheet to £14.5bn, an 87% reduction since its formation.

"The transaction delivers against our overarching objective to develop and execute divestment strategies which protect and maximise value for the taxpayer whilst treating customers fairly."