By Amrith Ramkumar

Warren Buffett's Berkshire Hathaway Inc. has put its gilded name behind one of the largest gold-mining firms, adding to the list of big-name investors making wagers tied to the precious metal at a time of significant economic uncertainty.

Berkshire late Friday disclosed that it held a $565 million stake in Barrick Gold Corp., the world's second-largest gold miner, at the end of the second quarter. The stake makes Berkshire the 11th-largest shareholder in Toronto-based Barrick, according to FactSet.

The move is striking because Mr. Buffett has in the past said he doesn't like investing in gold. Unlike dividend-paying stocks or high-quality bonds, buying and holding the metal in an investment portfolio generates no income. The Barrick stake is made up of common shares that pay a dividend.

New York-listed shares of Barrick surged 12% on Monday following the news of Berkshire's stake, bringing their advance in 2020 to more than 60%. Shares of other gold firms rose as well, while Berkshire's Class B shares dropped 1.6% on a mixed day for major U.S. stock indexes.

The news "is earth shaking in the gold market," said Bob Haberkorn, senior market strategist at RJO Futures, adding that Berkshire taking the stake in Barrick at the same time that it unloaded billions of dollars in bank stocks such as Wells Fargo & Co. and JPMorgan Chase & Co. was instilling more faith in the bullion rally.

A sharp rally in gold's price tends to be a sign of economic unease. Many buyers say they are taking refuge in gold because they believe ultralow interest rates and government stimulus enacted in response to coronavirus-related shutdowns will erode the value of paper money and stoke inflation. Gold becomes more attractive when interest rates are low, because low rates reduce the appeal of rival investments such as bonds, and draws in investors who are anticipating inflation because rising consumer prices mean it would take more dollars to buy the same amount of gold.

Many other notable investors have also touted gold in recent months or disclosed positions tied to the metal, including Ray Dalio and Jeffrey Gundlach.

Gold prices this month hit an all-time high, with most actively traded futures rising near $2,070 a troy ounce on Aug. 6. They have since retreated but remain up roughly 30% for the year, outpacing other popular assets like the tech-laden Nasdaq Composite stock index. They advanced 2.5% to $1,998.30 on Monday, with traders citing Berkshire's stake in Barrick as a reason for the advance.

Investing in gold miners is different from owning physical gold or futures contracts because miners can pay dividends to shareholders. Barrick said recently that it is increasing its second-quarter dividend by 14% to 8 cents a share. Barrick and other large gold miners such as Newmont Corp. have benefited from soaring metal prices recently. One of Berkshire's portfolio managers, Ted Weschler and Todd Combs, could have also taken the position in Barrick.

Berkshire and Barrick couldn't immediately be reached for comment.

Mr. Dalio's Bridgewater Associates LP, the world's largest hedge fund, recently disclosed that in the second quarter it increased its stakes in two popular exchange-traded funds that are backed by physical gold -- the SPDR Gold Shares and iShares Gold Trust. Bridgewater's combined stake in the two gold ETFs is valued at more than $1 billion, FactSet data show.

Since gold began surging last summer, other recognizable investors including Mr. Gundlach, chief executive of DoubleLine Capital, and Paul Tudor Jones have said they are also bullish on the metal. Gold prices are up about 50% since the end of May 2019, while gold's precious-metal peer silver has more than doubled since hitting a low in March.

Even among those who are bullish on gold, many are divided on the best way to invest in the metal. Shares of gold miners have failed to match gold's price gains for years and are known to be more volatile, with analysts citing challenges in finding new mines and operational obstacles in far-flung parts of the world driving big swings in gold-mining stocks.

However, some investors say shares of gold miners are now poised to outpace the metal, with their rising profits making them more attractive than many other sectors of the stock market that have been battered by the pandemic.

Many individual and institutional investors are now using them and popular precious metals ETFs to insulate their portfolios from the pandemic.

"We've been extremely busy since the spring with people buying gold and silver," RJO's Mr. Haberkorn said. "There's a fear out there right now."

--Nicole Friedman contributed to this article.

Write to Amrith Ramkumar at amrith.ramkumar@wsj.com