As the US stock markets continue to soar and set new records, a particular sector is posting big profits and beating Wall Street expectations. Health insurers, surrounded by political chaos concerning the Affordable Care Act (ACA), nevertheless recorded better than expected earnings for the second quarter. The six biggest US health insurance companies reported $6 billion in profits, up 29% from a year ago.

Health insurance giant UnitedHealth Group's (UNH  ) net profits jumped 28% to $2.3 billion. It posted earnings per share of $2.32. UnitedHealth has recently withdrawn from several ACA marketplaces but has been focusing on other business segments. It gave positive guidance and a forecast of $9.75 to $9.90 in 2017 earnings per share.

Health insurance giant Anthem (ANTM  ) beat on earnings but missed on revenue. It posted net profits of $855.3 million and earnings per share of $3.37, above analysts' estimates of $3.24. Its revenue was $22.2 billion, barely missing estimates. Anthem raised its dividend by 5 cents to 70 cents and expects 2017 earnings per share to be at least $11.70.

Cigna (CI  ) posted net profits of $813 million and earnings per share of $2.91, beating estimates of $2.48. A relatively small player in the ACA marketplaces, Cigna seems to have bounced back from a setback this year when its proposed acquisition by Anthem was blocked by antitrust regulators, forecasting 2017 earnings of $9.75 to $10.05 per share and a target of $16 in earnings per share by 2021.

Health insurance giant Aetna (AET  ) posted net profits of $1.20 billion and earnings per share of $3.42, wildly beating estimates of $2.35. It attributed benefits to exiting most ACA individual insurance markets this year. The company expects to lose $200 million on ACA plans in 2017, a smaller loss than in 2016. It also reported lower than expected member health costs and gave positive guidance for the year.

Health insurance giant Humana (HUM  ) posted net profits of $1.04 billion and earnings per share of $4.46. After a proposed merger between Humana and Aetna was blocked by the US Justice Department, Humana is focusing more on improving and expanding its Medicare Advantage segment, which provides benefits to senior citizens.

Centene (CNC  ) posted net profits of $254 million and earnings per share of $1.59, beating estimates of $1.30. Centene also gave positive guidance for 2017 and expects its ACA and Medicare businesses to keep growing. Unlike the bigger insurers, it plans to expand ACA healthcare coverage in Kansas, Missouri, and Nevada next year.

Healthcare insurance stocks have outperformed the S&P 500 in the last couple of months. In fact, insurance companies in general are doing well and reporting earnings beats. It could be an uptrend for the insurance industry. Some health insurers are exiting from ACA exchanges and focusing on other segments while others are expanding in the marketplaces. Regardless of legislative turmoil, both approaches seem to be working in terms of profitability.

The author does not hold any positions in any of the securities above.