Warren Buffett added to Berkshire Hathaway's (NYSE:BRK-A) (NYSE:BRK-B) position in Wells Fargo (NYSE:WFC) during the first quarter (Berkshire was already the California lender's largest shareholder), taking advantage of the market's fear and loathing of bank stocks. However, he did so ahead of a development that he himself had said would be "hugely negative for shareholders." Did he blunder?

A fly in the equity ointment
The event in question was the government's requirement that Wells Fargo raise $13.7 billion in equity capital on the back of its stress test results. That amount was the second largest among the 19 financial institutions under scrutiny (Bank of America (NYSE:BAC) "won" with a $33.9 billion capital shortfall while basket case Citigroup (NYSE:C) requires $5.5 billion). Wells subsequently raised $8.6 billion through a sale of 392.2 million shares at $22 apiece, diluting existing shareholders -- including Berkshire Hathaway -- by approximately 9.2%.

Margin of safety protects against dilution risk
Buffett isn't insane; although I don't think he was expecting Wells Fargo to have to raise capital, the prices at which he invested -- ignoring volume effects, Wells' average closing share price in the first quarter was $16.53 -- left him with a significant margin of safety against the risk of dilution. As far as the shares he already owned, their cost basis (coincidentally) almost exactly matches the $22 price at which shares were sold in the most recent offering.

Wells Fargo isn't the only bank in which Buffett snapped up more shares: He also added to his position in US Bancorp (NYSE:USB). No dilution cost there – U.S. Bancorp was given a clean bill of health by authorities.

Buffett points us in the right direction
The day after bank stress tests were released, I wrote: "Certain banks look like decent bets right now -- but I'd recommend that investors restrict themselves to the highest-quality names." Although they are no longer as attractive as they were during the first quarter (I don't think Buffett would go all in on Wells Fargo at recent prices), both these institutions certainly qualify on that criterion.

More Foolishness:

Take a hint from Warren Buffett's recent investments in Goldman Sachs preferred shares with fat yields: In this market, dividends -- those that are sustainable -- will be a big component of future shareholder returns. The team at Motley Fool Income Investor can show you how to build -- and manage -- a portfolio of stocks that pay a solid yield. To find out their top five recommendations for new money now, take advantage of a 30-day free trial today.

Alex Dumortier, CFA has a beneficial interest in Wells Fargo, but not in any other of the companies mentioned in this article. Berkshire Hathaway is a Motley Fool Stock Advisor and a Motley Fool Inside Value selection. The Fool owns shares of Berkshire Hathaway. The Motley Fool has a disclosure policy.