Bank of America shares closed Thursday at $24.32 a share, making that stake actually worth more than $17 billion. So it's a quick $12 billion paper profit for the Oracle of Omaha.

Buffett 's Berkshire Hathaway said Friday it will exercise warrants in Bank of America that will allow it to acquire 700 million common shares in the bank at an exercise price of just $7.14 each, or about $5 billion.

Because of an astute investment made in Bank of America six years ago while the bank was struggling, Warren Buffett is about to make a quick $12 billion and become the financial institution's largest shareholder.

After passing the second of two annual stress tests by the Federal Reserve, Bank of America said Wednesday it would hike its annual dividend to 48 cents a share, or 12 cents a quarter, a 60 percent increase.

That was enough for Berkshire to consider exercising those warrants rather than wait until just before their expiration in 2021.

This all goes back to Berkshire's 2011 deal to invest $5 billion in preferred shares of Bank of America, which at the time was struggling with numerous legal issues in the wake of the subprime mortgage crisis. The preferred shares pay a 6 percent annual dividend, or $300 million. At a dividend of 44 cents, the common shares would pay roughly the same. At 48 cents, Berkshire would get $336 million annually.

A move to exercise the warrants would be seen as bullish for Bank of America shares, an expression of confidence by Buffett that they have upward momentum. They rose 1 percent in premarket trading Friday to $24.58. They were already up 7 percent on the week.

Bank of America said it would make the dividend increase official "beginning in the third quarter of 2017." That period begins Monday. Berkshire said it will exercise the warrants once that hike is official, instantly making Buffett that $12 billion, or more if the stock continues to go higher.

The Buffett-led conglomerate will also then become the bank's biggest shareholder, surpassing Vanguard, which holds 6.6 percent, about 652 million shares, according to FactSet.

In the past, Berkshire indicated it would likely not execute the warrants until just before the 2021 deadline. But in his annual letter to shareholders, Buffett signaled a change of heart.

"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," he said in his annual letter to shareholders.

Berkshire is already the largest shareholder in another major financial institution: Wells Fargo. Buffett also has a sizable holding in Goldman Sachs, a stake that dates back to another shrewd investment made by the investing legend in the wake of the financial crisis.