Two of the largest U.S. lenders have complied with regulators’ demands to clear consumer-credit reports of debts that don’t belong there. The move is a win for borrowers struggling to regain their financial footing after going through bankruptcies, as reported by the New York Times.

In response to ongoing lawsuits, the Bank of America Corp. and JPMorgan Chase & Co. agreed to repair borrowers’ credit reports by August to reflect debts discharged under Chapter 7 of the U.S. Bankruptcy Code. The banks neither admitted nor denied wrongdoing in the action.

When the Great Recession plunged wide swaths of the American public into financial straits, many had nowhere to turn but bankruptcy court to unwind their mounting debts. More than 1.5 million Americans initiated the arduous process of declaring bankruptcy in 2010 alone.

But many of those borrowers found the nation’s largest banks were unwilling to erase discharged debts from their credit reports -- as is required by federal bankruptcy law -- hampering their ability to find employment and take out new loans.

When a borrower completes bankruptcy proceedings, financial firms must scrub old debts from credit reports. But banks such as Bank of America and JPMorgan, as well as Citigroup Inc. and Synchrony Financial, allegedly left the obsolete debts on credit reports, a practice that invited multiple bankruptcy lawsuits and an ongoing investigation by the U.S. Justice Department.

The motive for deliberately ignoring bankruptcy discharges was purely financial, according to the judge overseeing cases surrounding the practice. By leaving bankruptcy discharges on consumer-credit reports, banks could get better deals selling pools of bad debt to other financial institutions.