This year’s looking brighter for Berkshire Hathaway Inc.’s insurance businesses after 2017’s hurricanes led to the first annual underwriting loss in more than a decade.

Auto insurer Geico and the company’s namesake reinsurance business helped lift underwriting to a profit in the second quarter, adding to earnings during the first three months of the year, the Omaha, Nebraska-based company said Saturday in a statement. Last year’s annual underwriting loss broke a streak of profits more than a decade long.

Berkshire’s insurance businesses have played an integral role in the company even as Warren Buffett, the chairman and chief executive officer, expanded his conglomerate into industries including energy and railroads. Buffett has called the insurance operations the engine that powered Berkshire’s growth. The businesses generate float, or funds from premiums that Buffett can invest before claims are due.

New accounting rules that require Berkshire to report swings in the company’s stock portfolio started earlier this year. Those changes drove a $4.5 billion gain in the quarter, helping to almost triple net income. Operating earnings, which exclude those investment gains, surged 67 percent to $6.9 billion in the second quarter, helped by the insurers as well as the company’s railroad and manufacturing businesses.

Hurricanes Harvey, Irma and Maria pummeled the U.S. and Caribbean last year, weighing on results across the insurance industry. Buffett estimated that Berkshire’s loss from the storms was around $3 billion, according to his letter to shareholders in February.

Underwriting profit of $943 million from the insurers in the second quarter compared with a loss of $22 million in the same period a year earlier. Profit at Geico was more than five times earnings during the same period last year, helped by higher rates. Many insurers have been increasing prices after experiencing higher losses, partly due to more drivers on the roads. Berkshire Hathaway Reinsurance Group benefited from a lack of catastrophes in the quarter.

Berkshire’s smooth quarter contrasts with Allstate Corp. and Travelers Cos., which both reported catastrophe losses from weather events such as hail storms and mudslides. Travelers Chief Executive Officer Alan Schnitzer said he hadn’t seen a string of strong weather events like that in the last decade.

Cash Pile

Berkshire’s pile of cash and Treasury bills rose to $111 billion from about $109 billion in the first quarter. Buffett has been searching for ways to put that growing war chest to use, but has been frustrated in his search for large acquisitions. He lamented in his shareholder letter in February that prices were too high, and said his only “sensible stand-alone purchase” last year was a stake in Pilot Travel Centers for $2.76 billion.

Berkshire’s board opened up an avenue for capital deployment in July when it removed a cap on stock buybacks, allowing Buffett and Vice Chairman Charles Munger to repurchase shares whenever they believe the price is below Berkshire’s intrinsic value, “conservatively determined.” The company said Saturday that it hasn’t made any share repurchases in 2018.

Operating earnings from the company’s railroad climbed 37 percent to $1.3 billion, partly due to higher volumes and revenue per car, as well as lower tax rates. Buffett’s BNSF Railway Co. competes with Union Pacific Corp. in the western U.S. That company is dealing with higher costs as it tries to relieve congestion on its network.

Other highlights include:

Book value per Class A share climbed 3 percent from the first quarter to $217,677. Berkshire’s manufacturing and retailing businesses generated earnings of $2.14 billion, up from $1.66 billion a year earlier. That was helped by increases at TTI due to higher demand for electronic components, a business that helps service the petroleum and chemical industries, and NetJets, which offers fractional ownership of private jets. Profit at the utilities and energy unit rose to $581 million from $509 million a year earlier. Those businesses range from gas pipelines to electricity providers that span the U.S.