One of the top insurers in the nation reported Wednesday that it's spending more money on medical costs to cover sicker-than-expected Obamacare enrollees.

Anthem reported in its second quarter earnings that it is spending more on medical claims in part because of higher costs in it's individual business, which primarily includes Obamacare. The report comes as other insurers have decided to flee Obamacare exchanges because of losses due to sicker Obamacare enrollees.

The higher costs can be inferred from company's benefit expense ratio, which is a company's cost for providing medical care divided by revenues from premiums. Anthem's ratio was 84.2 percent in the second quarter, an increase from 82.1 percent over the same period last year.

That means 84 percent of every dollar the company gets from premiums goes to pay for medical claims, while the rest to administrative costs and profits.

Despite the rising costs, Anthem remains committed to the Obamacare exchanges and is hoping for the markets to eventually stabilize.

The insurer, which encompasses Blue Cross/Blue Shield, said its medical enrollment increased by 1.2 million members compared to last year. The insurer now has nearly 40 million enrollees in its commercial and government plans such as Medicare Advantage and Medicaid.

However, there was a slight decrease in the company's individual business in the last quarter.

Obamacare wasn't the only reason medical spending shot up for Anthem. Another major driver was higher membership in Medicaid, which usually carries higher medical costs, the insurer noted in an earnings release.

The report comes as other insurers have said they are either fleeing Obamacare, or expanding their participation.

UnitedHealth, the country's largest insurer, has said it is exiting a majority of the 34 markets it offers plans in next year. Humana has also planned to exit about 4 out of the 15 exchanges it offers plans next year.

Part of the rationale for those companies is mounting losses. UnitedHealth expects to lose $600 million in its Obamacare business, but remains very profitable in its other segments.

Insurers initially struggled when the markets were first created back in 2014. Experts believe that insurers generally underpriced their medical plans back in 2014 and Obamacare enrollees were sicker than expected. This led to higher claims and mounting costs.

A recent report from the Commonwealth Fund found that a majority of Obamacare insurers lost money in 2014.

Most expect higher premiums for 2017, and the latest report from the research firm Avalere Health projects an 11 percent hike for silver plans, the middle-tier plans offered by Obamacare. Experts say these hikes are a market correction to address underpricing several years beforehand.

But not all insurers are having problems in the individual markets. Cigna recently announced it is expanding its Obamacare business in several metropolitan areas, including Chicago.