Yesterday, shareholders of Bank of America (NYSE:BAC) got news they've been waiting for: the nation's second-largest bank by assets had finally settled its ongoing lawsuit with mortgage bond insurer MBIA (NYSE:MBI).

To the untrained eye, MBIA's case against Bank of America was the least of the latter's concerns. Since the financial crisis, the bank has paid out more than $40 billion to settle claims related to its -- or, rather, Countrywide Financial's -- sale of mortgage-backed securities to institutional investors leading up to the financial crisis. Its single biggest settlement, announced at the beginning of this year, added up to more than $10 billion. By comparison, MBIA was seeking a comparatively reasonable $3 billion to $4 billion in damages.

But the particularly contentious litigation had assumed a significance that far outpaced this range of liability. It's no exaggeration to say that MBIA's very existence turned on a favorable resolution. In a strange twist of fate, the company was on the hook for billions of dollars in insurance payouts to Merrill Lynch, which purchased the protection prior to its own acquisition by Bank of America. Had it been obligated to make the payments and thereby deplete its capital base, it was widely assumed that seizure by government regulators would follow soon thereafter.

The settlement, however, throws MBIA a lifeline. In addition to the $1.6 billion in cash that Bank of America will pay to the insurance company, the bank has also agreed to release MBIA from its obligations to Merrill Lynch, provide a $500 million line of credit, and to relinquish MBIA bonds that it had acquired as a bargaining chip during the battle. In exchange, Bank of America received warrants to purchase 4.9% of MBIA's common stock, which, if exercised, would provide additional capital for the latter.

The news was also good for Bank of America, as evidenced by its stock climb yesterday and today. Numerous legal issues in the dispute had recently been decided against the bank, and confirmation of those on appeal could have jeopardized other ongoing cases -- most notably an $8.5 billion settlement that's currently being litigated before a different judge in the very same court. While it's impossible to say whether or not fears of contagion were well-founded, the risk was simply too large. As my colleague Amanda Alix discussed, estimates of the damages if the settlement falls through range as high as $60 billion.

Since the beginning of the year, Bank of America's progress at resolving legacy legal issues relating back to the crisis has been nothing short of extraordinary. At the beginning of January, it settled claims with mortgage giant Fannie Mae. Last month, it settled three different class action lawsuits related to claims of securities fraud. And now this.

But while the end is finally in sight, there still remain a number of hurtles -- not the least of which is the aforementioned $8.5 billion settlement, which is scheduled for final arguments to start on May 30. Should you bet that the settlement will be approved? That's for you to decide. But make no mistake about it: that is the single largest catalyst remaining for the bank in the foreseeable future.