Warren Buffett's Berkshire Hathaway shifted investments in banks -- paring stakes in many of the financial industry's top names -- and bet on Barrick Gold despite years of chiding the precious metal.

Berkshire significantly reduced its stakes in JPMorgan Chase & Co and Wells Fargo & Co in the second quarter, according to a regulatory filing Friday (Saturday AEST).

His Goldman Sachs Group holding, a remnant of the financial crisis, was gone and even a wager on PNC Financial Services Group was cut. But Berkshire isn't giving up on banks, instead spending recent weeks further building its stake in Bank of America.

The second-quarter stock moves are consistent with Buffett's "extremely cautious" outlook expressed at this year's shareholders meeting, David Kass, a professor of finance at the University of Maryland's Robert H. Smith School of Business, said in an interview. "He's showing extreme caution by basically lightening up on his major banking investments except for Bank of America."

Buffett has famously called banks a good business as long as they don't make major mistakes. He has stood by longtime favourite Wells Fargo as it works to free itself from years of scandals.

Bank of America ranks as Berkshire's biggest bank holding by market value and its second-largest common-stock investment overall behind Apple.

Berkshire trimmed other stakes in financial firms. Buffett's company cut a holding in M&T Bank and an investment in Bank of New York Mellon. Even wagers on Visa and Mastercard were reduced in the second quarter.

Berkshire took a new position in Barrick Gold, buying 20.9 million shares, or 1.2 per cent of the company’s outstanding stock, with a current market value of US$565 million.

While the filing discloses the holdings overseen by Buffett as well as his deputies Todd Combs and Ted Weschler, the move marks a shift for a company run by an investor who has expressed his disdain for gold.

Buffett, Berkshire's chairman and chief executive officer, has previously chided investors who chose to bet on gold over stocks because of fears of runaway federal budget deficits.

"The magical metal was no match for the American mettle," Buffett said in his annual letter to shareholders released in 2019.

Kass called the Barrick investment "the biggest shock" from Friday's filing, and suggested that the size means it could be a stake made by Combs or Weschler.

"Still, you would think they would share Warren Buffett's sceptical philosophy of investing in gold, which he's expressed at several annual meetings as well as his letters to shareholders," Kass said. "Yet this suddenly shows up in his portfolio, almost as a hedge against possible bad times."