Image credit: iStock/Thinkstock.

Warren Buffett has been lying to us for years about his affinity for bank stocks. Here's what he had to say about investing in banks in his 1990 shareholder letter:

The banking business is no favorite of ours. When assets are twenty times equity -- a common ratio in this industry -- mistakes that involve only a small portion of assets can destroy a major portion of equity. And mistakes have been the rule rather than the exception at many major banks.

Pretty clear, right? The CEO of Berkshire Hathaway (BRK.A -0.28%) (BRK.B -0.68%) doesn't like banks. They're too risky for him; too poorly managed. He wouldn't buy them with your money, much less his own.

But fast forward to today, and guess what? A third of Berkshire Hathaway's $134 billion stock portfolio is invested in bank stocks, including Berkshire's warrants and preferred stock in Bank of America.

Bank Stocks Owned by Berkshire Hathaway

Value of Position

Share of Outstanding Common Stock

Wells Fargo (WFC -0.56%)

$23.1 billion

9.21%

Bank of America*

$8.8 billion

6.4%

American Express

$8.1 billion

15.25%

U.S. Bancorp (USB 1.56%)

$3.4 billion

4.73%

Goldman Sachs

$1.7 billion

2.52%

Bank of New York Mellon

$704 million

1.80%

M&T Bank (MTB 0.75%)

$586 million

2.95%

*Berkshire's position in Bank of America consists of $5 billion worth of preferred stock and warrants to purchase 700 million shares of its common stock for $7.14 a share. Data source: CNBC's Berkshire Hathaway Portfolio Tracker.

Why would Buffett say one thing, but do another? Charlie Munger, Berkshire Hathaway's vice chairman, shed light on this at the Daily Journal's annual meeting last month. Here's how he explained his decision as the newspaper company's chairman to use its cash to buy 1.6 million shares of Wells Fargo in 2009:

When Berkshire bought Wells Fargo [in the early 1990s], the world was unglued in a real estate lending-driven banking panic. We knew their bank lending officers weren't ordinary. They grew up in the garment district as cynics and were careful and better [than others]. This was an information advantage that we had that Wells Fargo had this special capacity. When [the Daily Journal] bought into Wells Fargo [in 2009] at $8 [a share], we knew the bankers were more rational than ordinary bankers. No one should buy a bank without a feeling for how shrewd management is. It is easy to delude yourself into thinking things, as it is very easy to hide the real numbers. Don't invest in banks without real knowledge.

Bank stocks can make great investments, in other words, but only if you know what you're doing. Thanks to the high leverage innate in bank business models, these companies are especially fragile. A mere 10% decline in the value of a typical bank's assets would leave it completely insolvent.

This is why banks fail all the time. As I've noted before, more than 17,000 banks have gone out of business over the past century and a half. That equates to an annual average of 113. In the most recent crisis, for instance, approximately 500 banks were closed by regulators.

But it's the flipside of this story that interests savvy and experienced investors like Buffett and Munger. Thanks to their appreciation for history, in particular, they know that certain banks not only survive the irregular but not infrequent crises that besiege the bank industry, but actually thrive as a result of the turbulence.

M&T Bank serves as a textbook example. It's generated an approximately 18,000% total shareholder return since 1983 by operating efficiently, obsessing over risk management, and then shrewdly purchasing competitors that are in or on the brink of failure after a downturn in the economy. The same is true of Wells Fargo, which more than doubled in size in the wake of the latest crisis thanks to its heavily discounted acquisition of Wachovia. And a similar playbook has positioned U.S. Bancorp to be the most profitable big bank in America.

In sum, Buffett and Munger are right that most investors should steer clear of bank stocks. But if you're nevertheless inclined to buy them, then you should limit your prospects to the ones in Berkshire Hathaway's portfolio, and specifically to Wells Fargo, U.S. Bancorp, and M&T Bank. There's no guarantee that these banks won't ultimately run into trouble, but the risk of that happening seems to be no greater than the risk of investing in any other type of company.