Warren Buffett’s Berkshire Hathaway Inc on Saturday said stock market gains fueled a record quarterly profit, while the billionaire signaled investors are undervaluing his company by repurchasing another $9 billion of its stock.

Berkshire’s fourth-quarter buybacks boosted the company’s overall stock repurchases to $24.7 billion in 2020, five times the record from a year earlier, and Berkshire appears to have repurchased another $4 billion or more in 2021.

“The math of repurchases grinds away slowly, but can be powerful over time,” Buffett wrote in his annual letter to Berkshire shareholders. “The process offers a simple way for investors to own an ever-expanding portion of exceptional businesses.”

Berkshire said quarterly operating income rose 14% to $5.02 billion, or approximately $3,252 per Class A share, from $4.42 billion, a year earlier.

Several manufacturing, service and retail businesses posted “significant” increases in revenue and earnings from last year’s pandemic-depressed second quarter, Berkshire said.

Net income, reflecting gains in stocks such as Apple Inc , rose 23% to $35.84 billion. Buffett believes net income is a misleading performance measure because of the volatility from stocks’ ups and downs.

“Broadly speaking, results were generally in line” with expectations, said Cathy Seifert, an analyst at CFRA Research.

She said the negative impact of the coronavirus pandemic was offset by “decent top-line growth” in Berkshire’s commercial lines and reinsurance businesses, and cost-cutting at the BNSF railroad, which shed 5,600 jobs last year.

For all of 2020, operating income fell 9% to $21.92 billion. Net income fell 48% to $42.52 billion, overcoming a nearly $50 billion first-quarter loss when the pandemic took hold.

Jim Shanahan, an analyst at Edward Jones & Co, expects 2021 to be “much stronger” for Berkshire, “dependent upon the speed of vaccinations and the opening of the U.S. economy.”

Buybacks Look “Compelling”

Berkshire’s shares trailed the broader market significantly in 2019 and 2020, though they have outperformed in 2021. Its stock buybacks dwarfed Berkshire’s old record $5 billion from 2019.

Tom Russo, a partner at Gardner, Russo & Gardner in Lancaster, Pennsylvania, a longtime Berkshire shareholder, welcomed the buybacks.

“At a discount of 40% to intrinsic value, the repurchases looked extraordinarily compelling,” he said. “Repurchases capture forever the benefits of Berkshire’s businesses for the remaining shareholders.”

Results benefited from improved quarterly performance at the Geico auto insurer, where the rate of accident losses declined as people drove less, helping offset rebates that were offered to encourage policyholders to renew.

Quarterly profit rose 5% at BNSF, as operating revenue and shipping volumes began to rebound from depressed pandemic-induced levels, while profit from Berkshire’s namesake energy operations rose 12%.

Buffett, in his letter, said both businesses will require major capital expenses for decades to come, but “likely to deliver appropriate returns” on that investment.

A yearlong trouble spot was Precision Castparts, which shed more than 13,000 jobs, or 40% of its workforce, in 2020 as the pandemic drained aerospace industry demand for its parts.

Berkshire said Precision’s margins began to improve in late 2020 and is likely to see further improvement in 2021.

But Buffett said that while Precision was “a fine company–the best in its business,” he made a “mistake” by overpaying when he spent $32.1 billion to acquire in 2016.

“I was right in concluding that PCC would, over time, earn good returns on the net tangible assets deployed in its operations,” he said. “I was wrong, however, in judging the average amount of future earnings…. PCC is far from my first error of that sort. But it’s a big one.”