Warren Buffett may not have supported Donald Trump's candidacy for president, but the 86-year-old billionaire certainly benefited from the unexpected outcome.

Stocks are up across the board since the presidential election, boosting the value of Berkshire Hathaway's (NYSE:BRK-A) (NYSE:BRK-B) stock portfolio, but few stocks have rallied as much as Bank of America (NYSE:BAC).

The Dallas skyline, with the Bank of America building in the foreground.

The Bank of America building dominates the Dallas skyline. Image source: Getty Images.

In 2011, during the darkest days of Bank of America's struggle to survive the fallout from the financial crisis, Buffett called the bank's CEO Brian Moynihan with an idea. Buffett would inject $5 billion of Berkshire Hathaway's cash into Bank of America, giving the bank a much-needed seal of approval.

But the deal had to be done on highly favorable terms to Berkshire Hathaway. Buffett demanded $5 billion worth of preferred stock yielding 6%, or $300 million a year. On top of that, the bank kicked in warrants to buy 700 million shares of Bank of America stock for $7.14 per share, exercisable at any time before the middle of 2021.

It's those warrants that have become so extraordinarily valuable since the presidential election. Last February, the low point for bank stocks in 2016, the warrants were worth $2.8 billion. By the beginning of November their value had climbed to $6.3 billion.

That alone makes Buffett's bet on Bank of America an incredibly lucrative investment. But it's what has happened since then that makes it extraordinary, as the rally in bank stocks following the presidential election has pushed the value of those warrants up to $11.9 billion.

A line graph charting the value of Berkshire Hathaway's investment in Bank of America's warrants.

Data source: Yahoo! Finance. Chart by author.

All of this comes on the heels of Trump's unexpected victory in the election, which convinced investors that profits at banks like Bank of America could soon soar. And so long as Trump follows through on his campaign vows to boost economic growth and reduce regulations in the bank industry -- while steering clear of a trade war -- it seems reasonable to assume that investors could be proven right.

But perhaps no one has benefited more from this than Buffett and Berkshire Hathaway. Combined with the $2.4 billion in dividends from its Bank of America preferred stock, the conglomerate's $5 billion bet on the nation's second biggest bank by assets is now worth just under $20 billion. That's a fourfold increase in less than six years.

Buffett may not be happy about Trump's presidency, but his net worth has certainly benefited tremendously.

Investors' takeaway

It's tempting to follow the lead of successful investors like Buffett. But before piling into Bank of America's stock, there are a number of things to keep in mind.

The first is that its shares are no longer as cheap as they once were. When Buffett invested in the North Carolina-based bank, its stock traded for around $6 a share. Today, they're more than $24 a share. That's taken a lot of the gain out of it.

Also, Buffett's investment wasn't an outright purchase of common stock, which is how an ordinary investor would invest in Bank of America. It consisted instead, as explained, of preferred stock with warrants to purchase common stock. Consequently, even if investors wanted to replicate his successful bet on Bank of America, it's all but impossible to do so.

This isn't to say that Bank of America isn't a good buy today, as it's still one of the most reasonably priced big bank stocks. It trades for right around 1 times book value compared to its peer group average of 1.5 times book value.

But it is to say that it's not anywhere near as good of a buy now as it was in 2011. To compensate for this, anyone buying it today should do so with the intent to hold it for years, if not decades. This will allow the law of compounding returns to overshadow a marginally high purchase price.