Warren Buffett's Berkshire Hathaway can finally claim a victory in the health-care sector.

UnitedHealth is paying $4.9 billion for a division of DaVita, the kidney dialysis center operator that counts Berkshire as its biggest shareholder, with a 20 percent stake. The one-day paper profit to Berkshire is more than $231 million.

The deal is for DaVita Medical Group, which operates 300 clinics and a handful of outpatient surgical centers in six states. It will be folded into UnitedHealth's Optum group, which includes pharmacy benefits, data analytics, clinics, surgical centers and home care.

The rest of DaVita will be left to focus on the kidney care business. It says it will use the proceeds of the sale to buy back stock and pursue other investments.

Berkshire began investing in DaVita in 2011. The stock has been a favorite of Berkshire portfolio manager Ted Weschler, who has a personal stake in the medical services company of 2.2 million shares, according to FactSet.

But it hasn't always been a slam dunk. At the end of 2011, DaVita shares traded at about $38, rising to $75 by the end of 2014. But they are down 20 percent since then, closing on Tuesday at $60.93.

DaVita shares jumped more than 10 percent after the deal was announced on Wednesday.

Berkshire has dabbled in health care in the past with mixed results. It was once an investor in UnitedHealth and WellPoint but sold off those shares in 2010, around the time the Affordable Care Act was transforming the health insurance landscape. It also once held a big stake in Johnson & Johnson but pared that back over the years.

The health industry is scrambling to respond to the growing threat of Amazon.com, the e-commerce giant that is said to be exploring a move into the pharmacy business. That potential competitive threat is partly the reason behind CVS Health's $69 billion deal to buy Aetna.