The US government has reached a $16.65bn settlement with Bank of America over its role in the sale of mortgage-backed securities in the run-up to the financial crisis, the Justice Department has announced.

The deal calls for the bank, the second-largest in the US, to pay a $5bn cash penalty and provide billions of dollars of relief to struggling homeowners.

Bank of America said its cash payouts will total $9.65bn. The settlement is by far the largest deal the Justice Department has reached with a bank over the 2008 mortgage meltdown.

Al Jazeera's Tom Ackerman, reporting from Washington, said: "With previous penalties, fines and legal costs they [US banks] have now paid about $80bn to deal with the aftermath of the mortgage crisis of 2008/9."

In the last year, JPMorgan agreed to a $13bn settlement while Citigroup reached a $7bn deal.

"This historic resolution - the largest such settlement on record - goes far beyond the cost of doing business," Attorney General Eric Holder told a news conference on Thursday.

"Under the terms of this settlement, the bank has agreed to pay $7bn in relief to struggling homeowners, borrowers and communities affected by the bank's conduct.

"This is appropriate given the size and scope of the wrongdoing at issue."

Associate Attorney General Tony West said the settlement of nearly $17bn is the largest the Justice Department has ever reached with a single entity in US history.

At a news conference, Justice Department officials said the settlement does not release individuals from civil charges, nor does it absolve Bank of America, its current or former subsidiaries and affiliates or any individuals, from potential criminal prosecution.

Of the $16.65bn, almost $10bn will be paid to settle federal and state civil claims by entities related to residential mortgage-backed securities, collateralised debt obligations and other types of fraud.

An independent monitor will determine whether Bank of America is satisfying its obligations under the settlement.

Source: Al Jazeera and agencies