Shares of Bank of America (NYSE:BAC) were up 2% on Wednesday after the bank announced that Warren Buffett's Berkshire Hathaway (NYSE:BRK-A) (NYSE:BRK-B) had exercised its right to purchase 700 million shares of the bank's common stock.

As Bank of America explained in a press release issued Tuesday, Berkshire Hathaway's right to purchase the stake came from the conglomerate's $5 billion investment in the bank's preferred stock in 2011. With that deal, which helped to buttress Bank of America's fortunes at the nadir or its post-financial crisis troubles, Berkshire acquired warrants to buy the shares for $7.14 each.

Warren Buffett making his way through the crowds at Berkshire Hathaway's annual meeting.

Warren Buffett, the chairman and CEO of Berkshire Hathaway. Image source: The Motley Fool.

Berkshire executed the purchase not by injecting new funds into Bank of America, but rather by converting its existing $5 billion worth of preferred stock. Buffett had telegraphed that he would do so earlier this year in his latest letter to shareholders:

[Bank of America's preferred] stock, which pays us $300 million per year, also carries with it a valuable warrant allowing Berkshire to purchase 700 million common shares of Bank of America for $5 billion at any time before September 2, 2021. At yearend, that privilege would have delivered us a profit of $10.5 billion. If it wishes, Berkshire can use its preferred shares to satisfy the $5 billion cost of exercising the warrant.

If the dividend rate on Bank of America common stock -- now 30 cents annually -- should rise above 44 cents before 2021, we would anticipate making a cashless exchange of our preferred into common. If the common dividend remains below 44 cents, it is highly probable that we will exercise the warrant immediately before it expires.

It was Bank of America's decision in June to raise its dividend that accordingly prompted Berkshire Hathaway to convert its preferred stock into common stock. Prior to that, Bank of America paid $0.075 per share in dividends each quarter. Following the hike, it pays $0.12 per share.

"In 2011, we welcomed Berkshire Hathaway as a shareholder, and we appreciate their continued support now as our largest common shareholder," said Bank of America chairman and CEO Brian Moynihan.

Bank of America's CEO Brian Moynihan, standing in front of two rows of desks.

Bank of America chairman and CEO Brian Moynihan. Image source: Bank of America.

Beyond this news, Buffett also gave an interview to CNBC's Becky Quick in which he talked about Bank of America, saying:

It will be a long, long time before we sell a share of Bank of America. I'm very happy. We have 700 million shares. I like the business. I like the valuation. And I like the management very much. So I think you see that for a long time in our holdings.

This is great news for Bank of America. Buffett is the most revered bank investor in the United States, having accumulated major ownership stakes in many of the nation's leading banks for Berkshire Hathaway. Consequently, having him as the bank's biggest shareholder gives Bank of America an important and valuable seal of approval.

And, of course, Buffett didn't do too bad either. All told, Berkshire has made about $13 billion in profit from its investment in the Charlotte, North Carolina-based bank.

John Maxfield owns shares of Bank of America. The Motley Fool owns shares of and recommends Berkshire Hathaway (B shares). The Motley Fool has a disclosure policy.