Health insurer stocks heated up in July.

UnitedHealth Group, Anthem and several others outpaced the broader market in what has been an otherwise choppy year for the sector. The sector is also holding up surprisingly well during the most recent round of corporate earnings. It is showing solid profit growth while companies within the broader S&P 500 are expected to report an overall contraction.

Stocks within the sector spiked on July 11 after President Donald Trump nixed a regulation that would have changed how prescription drug rebates work for Medicare beneficiaries. The rebates are paid from drugmakers to insurance companies and middlemen and changes would have sent them directly to seniors. Yanking the regulation was a win for insurers and pharmacy benefit managers.

The sector has outshined most other industries and the broader market during the latest round of corporate earnings. It’s showing solid profit growth while companies in the S&P500 index are expected to report an overall contraction.

UnitedHealth raised its profit forecast for the year after its second quarter profit jumped nearly 13%. Its pharmacy benefit management operation was a key factor in the profit boost. OptumRx added more customers and expanded into specialty services, including the infusion of drugs at patients’ homes.

Anthem also raised its profit forecast after beating second quarter expectations. The insurer reported solid gains from its pharmacy benefit manager IngenioRx, which it started with help from CVS Health.

Election season politics have hung over some of the largest insurers as presidential candidates and others call for changes to the American health care system. Congress is debating ways to lower drug prices and any changes could impact pharmacy benefit managers, including UnitedHealth’s OptumRx unit. The industry is also still contending with changes to the Affordable Care Act that went into effect this year, including the elimination of the individual mandate.

The bumpy ride this year has been partly driven by Democratic presidential candidates and their calls for changes, some drastic, to the health insurance system. Some of those proposals have spooked investors, including Elizabeth Warren’s call to completely scrap private insurance.

Analysts, though, have brushed off worries over any actual impact of the plans.

“We continue to view drastic changes to the current health care system as unlikely and instead believe buildout and tweaks are more practical and realistic, if anything at all,” wrote Citi analyst Ralph Giacobbe in a note to investors earlier this month.