Pablo Martinez Monsivais, Associated Press
Rep. Steve King, R-Iowa speaks during a news conference on Capitol Hill in Washington, Tuesday, Jan. 18, 2011, after accepting delivery of signed petitions demanding the repeal of \'ObamaCare\' .

Health insurance companies spent millions of dollars in an effort to prevent passage of the U.S. health care overhaul two years ago because they thought it would raise costs and disrupt coverage. Those companies have had their biggest profit margins since the recession began, according to a Bloomberg government study.

Insurance companies recorded their largest quarterly net gains of the past 10 years since the law was signed in 2010, said Peter Gosselin, the author of the study and senior health care analyst for Bloomberg government.

During that time, the Standard and Poor's 500 Managed Health-Care Index went up 36 percent.

Health insurers contributed $86.2 million to the U.S. Chamber of Commerce to resist the law, according to Bloomberg.

"The industry that was the loudest, most persistent critic of this law, the industry whose analysts and executives predicted it would suffer immensely because of the law, has thrived," Gosselin said.

Health insurance companies saw their average profit margins swell from 6.88 percent in the 18 months preceding the overhaul to 8.24 percent in the six quarters since.

America's Health Insurance Plans, the industry's lobbyist in Washington, still says on its website that the law will cause rates to increase and people to lose their health insurance.

Along with the new profits health insurance companies are achieving is a change in their source of revenue.

Commercial business now accounts for the smallest amount of revenue in more than two decades, according to the Bloomberg study. Commercial business accounts for less than 50 percent of the companies' combined revenue. Part of the reason for that is the companies' growing investments in Medicaid and Medicare, according to the Bloomberg report.

Quarterly revenue from Medicare, the $525 billion federal health program for the aged and disabled, rose one third, to $16.39 billion, for the four insurers that reported their figures, according to the study. Revenue from Medicaid more than doubled to $4.11 billion.