Founded in 1993 by brothers Tom and David Gardner, The Motley Fool helps millions of people attain financial freedom through our website, podcasts, books, newspaper column, radio show, and premium investing services.

When Bank of America recently reported its best earnings since the financial crisis, the biggest news involved a closely watched legal dispute in New York's highest court.

When Bank of America(NYSE:BAC)reported earnings earlier this month, its chief financial officer Bruce Thompson casually referenced a court case on the earnings call that seems to have cleared the way for the nation's second biggest bank by assets to move beyond the financial crisis.

The bane of Bank of America's existence over the past seven years can be traced to so-called representation-and-warranty, or put-back, claims. These give institutional investors who purchased mortgages from the North Carolina-based bank in the lead-up to the crisis the legal right to return defectively underwritten mortgages for a refund.

This wouldn't have been a material issue for Bank of America on its own, just as it hasn't been for its one-time California neighbor Wells Fargo. But what transformed put-back claims into an existential crisis for the $2.2 trillion bank was its 2008 acquisition of Countrywide Financial.

As the housing market gasped for breadth on the eve of the crisis, Countrywide abandoned any semblance of prudence when it came to underwriting mortgages. A borrower's income, assets, and ability to repay the loan fell by the wayside. In their place, Countrywide incentivized speed and volume. This buoyed the mortgage originator's profits in the short-run, but yielded hundreds of billions of dollars' worth of toxic mortgages, many of which were all but guaranteed to default.

Countrywide compounded its malfeasance by selling the mortgages to insurance companies, university endowments, Fannie Mae, and other institutional investors under the pretense that the loans were the product of prudent underwriting. But because they weren't, institutional investors began demanding that Countrywide -- which, by that time, had been acquired by Bank of America -- take the mortgages back or otherwise compensate them for their losses.

"In a rush to feed at the trough of easy mortgage money on the eve of the financial crisis, Bank of America purchased Countrywide, thinking it had gobbled up a cash cow," said U.S. Attorney Preet Bharara in 2013. "That profit, however, was built on fraud."

Bank of America's $8.5 billion settlement four years ago with 22 institutional investors over $424 billion worth of Countrywide mortgages serves as a textbook example of the resulting carnage. The deal, which was later eclipsed in size by similar agreements with Fannie Mae and government regulators, eviscerated the bank's 2011 earnings and spawned years of expensive litigation until the settlement was ultimately approved by a court this year.

It's these types of claims, in turn, that have been curtailed by the case cited by Thompson on Bank of America's latest conference call. As he explained, the court in ACE Securities Corp. vs. DB Structured Products held that put-back claims filed more than six years after the mortgages were sold are void under New York's six-year statute of limitations.

This allowed the bank to reduce its estimate of outstanding put-back claims by $7.6 billion. Even more dramatically, the case transformed the torrent of new put-back claims received by Bank of America into a relative trickle. From the second quarter of last year through the first quarter of this year, institutional investors submitted an average of $2.6 billion worth of put-back claims each quarter. Following the ruling, the inflow plummeted to $224 million in the most recent quarter.

It's entirely possible, of course, that Bank of America has over-estimated the impact that the ACE Securities Corp. decision will have on its future results. It made this mistake in 2011 when it essentially led investors to believe that the worst of the mortgage litigation was in the rearview mirror even though, as we later found out, it was only about halfway through the unfolding debacle.

But I don't think this is the case this time around. Not only has Bank of America likely learned from its premature pronouncements of yore, but the passage of time has also given it an opportunity to get a better handle on the magnitude of its remaining put-back exposure. The net result is that Bank of America may finally be able to soon close the file on the worst corporate acquisition in American history.