Wells Fargo, the largest U.S. home lender, settled legal disputes with federal regulators tied to mortgage-backed securities for about $335 million.

The accord, which included the Federal Housing Finance Agency and covered agreements from the first and third quarters of this year, was disclosed today in a regulatory filing by San Francisco-based Wells Fargo. The sum was covered by reserves, the bank said.

The bank, led by Chief Executive Officer John Stumpf, is among U.S. lenders seeking to resolve disputes over flawed loans sold to government-backed firms. The six biggest U.S. banks have piled up more than $100 billion in legal costs, including settlements and lawyers’ fees, since the financial crisis, data compiled by Bloomberg show.

Wells Fargo cut its estimate of potential legal bills that aren’t already covered by reserves to $1 billion at the end of the third quarter, from $1.1 billion at midyear, the filing shows. The estimate for potential uncovered costs of buying back faulty mortgages from investors dropped to $1.4 billion from $2.2 billion.

Read more: