While Bank of America (NYSE:BAC) has clawed its way back to financial viability over the last five years, one threat remained lurking in the background that could have crippled it in one fell swoop -- until today, that is.

In the decade before the financial crisis, Countrywide Financial, the subprime-mortgage-originator-cum-criminal-enterprise that B of A purchased in 2008, sold more than $1.4 trillion in mortgages to Fannie Mae. Because the lion's share of these loans were tainted by fraud, the potential liability assumed by B of A in the form of repurchase claims was mind-boggling. At one point, I estimated the range at between $4.7 billion and $40.9 billion.

While B of A narrowed this range during its third-quarter conference call, estimating that total liability from both public and private investors wouldn't exceed $6 billion in excess of allocated reserves, one couldn't help but question the accuracy of this prediction. It's this uncertainty, in turn, that's kept a lid on B of A's share price.

Well, my fellow B of A shareholders, do I have good news for you. This morning, the bank announced that it reached a settlement with Fannie Mae to "extinguish substantially all of those unresolved claims, as well as any future representations and warranties claims associated with loans sold directly to Fannie Mae" in the eight years before the crisis.

As a part of the deal, B of A will pay Fannie Mae $3.6 billion in cash and repurchase $6.75 billion of impaired mortgages. It will pay an additional $260 million to settle "substantially all of Fannie Mae's outstanding and future claims for compensatory fees arising out of past foreclosure delays." The actions taken together are expected to reduce the bank's pre-tax income by approximately $2.7 billion in the fourth quarter of 2012.

While there's no question that this settlement is expensive, it nevertheless should be heralded by shareholders. If I had to identify the two catalysts for B of A's share price going forward, they would be reducing legal liability and increasing dividends. With these in mind, it's no coincidence that this settlement was announced today -- the very same day, that is, that lenders like B of A, JPMorgan Chase (NYSE:JPM), and Citigroup (NYSE:C) submit their documents to the Federal Reserve for the 2013 stress tests. By reducing the associated uncertainty, B of A has positioned itself to seek and receive approval to increase its dividend in 2013 -- though, of course, there's no guarantee that said approval will be forthcoming. Suffice it to say, such a move would fuel another rally in B of A's share price.

It's worth noting, moreover, that B of A will earn a profit in the affected fiscal quarter despite the massive charge. According to the press release announcing the settlement, the bank "expects earnings per share to be modestly positive for the fourth quarter of 2012." If you had any doubts about B of A's earnings ability, in turn, this should quell those.

And as a final note, though these issues are beyond the scope of this article, there were three other announcements today that further remove the cloud from atop of B of A's patently undervalued shares. First, along with nine other mortgage servicers including Wells Fargo (NYSE:WFC) and PNC Financial (NYSE:PNC), B of A has entered into a multibillion dollar settlement with banking regulators resolving claims related to faulty mortgage foreclosure practices. Second, B of A signed agreements to sell the servicing rights on roughly 2 million mortgages held by public and private investors. And third, over the weekend, international banking regulators eased up on proposed regulations that would have negatively affected the profitability of banks.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.