THE past few years have been tumultuous for American health insurers. Barack Obama’s landmark health-care reform spawned a bevy of co-operatives to compete with them, among other measures intended to cut the cost of insurance. More than half of these have already gone bust—most recently Health Republic of New York. It had received $265m in federal loans but closed on December 1st, leaving 200,000 people in search of a new insurer. That is partly because the exchanges on which co-operatives and private insurers alike were supposed to sell lots of new policies have proved a disappointment: last month UnitedHealthcare, America’s biggest health insurer, announced that it may stop selling policies on them. Meanwhile, presidential candidates are demanding tougher government scrutiny of pending industry mergers. The public is hostile too: a survey published in August by the Kaiser Family Foundation, a think-tank, found health insurers were even more disliked than other corporate punchbags, such as banks and airlines.

Yet the share prices of America’s five biggest health insurers—UnitedHealthcare, Aetna, Humana, Cigna and Anthem—have all roughly tripled over the past five years. The big insurers have been consistently and highly profitable (see chart). Unlike most big American firms, the trend is still upward. All five will probably report record profits for this year, next year and several more to come, predicts Ana Gupte, an analyst with Leerink, a research firm. For that, they owe a debt of gratitude to an unlikely creditor. The results of most financial firms may have buckled under the weight of new regulation, but health insurers appear to be thriving in the complicated new regulatory environment.

When firms like Cigna and Aetna sold off other insurance businesses in the 1990s to concentrate on health care, it seemed that the dynamic businesses were being divested, leaving lumbering rumps. But in America, at least, health care turns out to be the most exciting corner of the industry. The vast expense and unintelligible complexity of American health care may be a national disgrace, but they are a huge opportunity for firms that can navigate the system and minimise costs.

Take Medicaid (government health care for the poor), which is run by the states. One by one they are coming to the conclusion that it is simpler to hand the whole sorry business to private contractors. In the past year Texas and Florida have done so; Michigan and Iowa will follow suit in 2016.

Medicare (government health care for the elderly) is an even bigger opportunity. The number of recipients is rising as baby-boomers reach the age of eligibility (65). In 2006 one in six received their coverage via a scheme called Medicare Advantage, which is farmed out to private firms. That number, says Ms Gupte, is now probably one in three, and may soon be one in two.