Berkshire Hathaway Inc. repurchased $928 million of its stock in the third quarter, a rare move that indicates Chairman Warren Buffett sees a dearth of appealing investment options for his company’s large cash pile.

It is the first time Berkshire has bought back stock since 2012. The decision, announced in a quarterly filing Saturday, illustrates the scarcity of attractively priced projects and deals that can satiate yield-hungry investors and firms more than nine years into a bull market.

A legendary value investor best known for striking deals when prices are low, Mr. Buffett has struggled to find large investments that aren’t overvalued. Berkshire hasn’t made a major acquisition since it bought Precision Castparts Corp. for about $32 billion in 2016.

Mr. Buffett, whose moves are widely watched for what they could mean to broader markets, is the latest to join in the buyback boom: Stock repurchases by S&P 500 companies hit a record in the second quarter, according to S&P Global Market Intelligence.

Berkshire has made small acquisitions in the past two years and poured billions of dollars into buying a stake in Apple Inc. But the company’s many businesses, such as Duracell, Geico and BNSF Railway, have continued to generate cash at a fast pace.