Bank of America, the US financial giant which acquired Countrywide, the nation's largest subprime mortgage lender, at the peak of the credit crunch, will pay $8.5bn (£5.2bn) in the biggest-ever settlement of claims over toxic mortgage bonds.
And it said it would put aside an additional $5.5bn to cover further liabilities, in a move it hopes will allow the company to finally draw a line under a crisis that took it twice to the brink of collapse.
The size of the settlement stunned Wall Street, but BoA shares led the banking sector higher as investors decided the move helped lift a cloud of uncertainty that threatened to hang over the industry through years more legal fighting.
Countrywide did more than almost any other lender to infect the financial system with mortgages handed to unsuitable borrowers, without the necessary paperwork and in contravention of its stated underwriting standards. The investors who purchased securities backed by Countrywide and other BoA mortgages have been suing to require the bank to buy the bad loans back.
Some of the most powerful investment firms in the world were on the other side of the legal tussle with BoA, which the bank's chief executive, Brian Moynihan, had originally promised to fight with "hand-to-hand combat". The parties to the settlement include Pimco, BlackRock and the New York branch of the Federal Reserve, which took mortgage-backed securities as collateral during its Wall Street bailout operations.
Mr Moynihan said that it would have been "much more adverse to the company" to keep fighting. "It is our job, management's job, to eliminate risk," he said. "We will continue to act aggressively, and in the best interest of our shareholders, to clean up the mortgage issues largely stemming from our purchase of Countrywide."
BoA had already agreed other smaller settlements earlier this year, including a $3bn deal with the nationalised mortgage finance houses Fannie Mae and Freddie Mac.
The effects of soaring delinquencies and foreclosures on US mortgages were felt across the financial system, because mortgages had been packaged into securities that were sold around the world. Those securities, too, were packaged into still more financial products, and losses spread quickly to banks and investors around the world, ultimately triggering a full-on panic in 2008.
Now US judges are battling their way through a thicket of lawsuits, as banks and investors fight over who has legal liability for the losses on mortgage securities and their derivatives.
BoA, through its own operations and those of the firms it acquired, accounts for about one in five of the mortgage securities sold between 2005 and 2007. Its settlement could put pressure on other big players – notably JPMorgan Chase and Wells Fargo – to follow suit.