By Geoffrey Rogow

Warren Buffett's Berkshire Hathaway Inc. said its second-quarter earnings surged 86%, as a rebound in the stock market offset a profit decline in the company's operations and a large write-down for Precision Castparts Corp.

Berkshire reported second-quarter net earnings of $26.3 billion, or $16,314 per Class A share equivalent, from $14.1 billion, or $8,608 per Class A share equivalent, in the year-earlier period.

Operating earnings, which exclude some investment results, fell to $5.5 billion from $6.1 billion in the year prior. Profits increased within the company's vast insurance operations, especially underwriting, while railroad, utilities and energy, and other businesses declined.

Berkshire took a $9.8 billion write-down for Precision Castparts in the quarter. Berkshire bought Precision Castparts for about $32 billion in 2016. The company, which supplies parts for aircraft makers and makes equipment for power stations and the oil-and-gas industry, has been hurt by the coronavirus pandemic.

Berkshire runs a large insurance operation as well as railroad holdings, utilities, industrial manufacturers, retailers and even auto dealerships. It also holds large investments, especially in the stock market.

An accounting-rule change in recent years has meant that Berkshire's earnings often reflect the larger performance of the stock market. Given the change, the company's operating earnings are often a more accurate reflection of the performance of its vast business operations.

The earnings report comes amid a tumultuous year in the economy and markets due to the impact of coronavirus. In the first quarter, stocks traded in a narrow range before selling off in March. Those market declines dented Berkshire's profit in the first quarter.

Stocks have rebounded significantly since then. The S&P 500 finished the second quarter up 20%, its biggest percentage gain since the last three months of 1998.

Despite a reputation for often either purchasing companies outright or making direct loans during turbulent times in markets, Mr. Buffett's firm was largely silent for much of the pandemic. The firm's biggest deal came in early July when Berkshire announced an agreement to buy Dominion Energy's midstream energy business for $9.7 billion including debt. The purchase is typical for Mr. Buffett in that Dominion's stock was in decline, and he knows the sector well.

Berkshire has been an active seller in some significant stock holdings during the pandemic. Berkshire sold out of all of its airline holdings and more recently, disclosed that it had slashed the bulk of its holdings in Goldman Sachs Group Inc. The firm has been buying shares of Bank of America Corp., according to regulatory filings.

Berkshire increased its buyback plan in the quarter, adding about $5 billion of its stock. It purchased $1.74 billion in Berkshire stock a quarter ago. Berkshire went years without buying back its stock. Mr. Buffett has long argued that he could better increase shareholder value through investments than through buybacks or dividends.

But the firm has taken on buybacks regularly since 2018.

Class A shares closed Friday at $314,333.88, down 7.4% for the year. By comparison, the S&P 500 is up 3.7% for the year.

The 89-year-old Mr. Buffett, whose shrewd investments have earned him the nickname "the Oracle of Omaha," has plenty of cash on hand for future acquisitions as a way to drive profit. Berkshire held $146.6 billion in cash at the end of the second quarter, up from about $137.3 billion in cash at the end of the first quarter.

Write to Geoffrey Rogow at geoffrey.rogow@wsj.com


   Corrections & Amplifications

This story was corrected August 9, 2020, to fix the misstated amount of stock purchased in Berkshire stock in the first quarter; it is $1.74 billion, not $1.74.