Anthem reported a 10.2% fall in operating profit from its unit which sells government health plans, in the quarter, saying the decline was driven by continued elevated medical cost trends in Medicaid in some states.

Concerns about medical costs took the shine off the group's better-than-expected second-quarter earnings and increased full year forecast for adjusted earnings, which in part reflected the successful launch of its new pharmacy benefits business.

As regulatory uncertainties about the health insurance sector persist ahead of the 2020 U.S. presidential elections, Anthem has doubled down on diversifying its business and in May started shifting members to the new pharmacy benefits unit, IngenioRx.

The Indianapolis, Indiana-based company raised its 2019 adjusted net income forecast to over $19.30 per share from a prior estimate of greater than $19.20.

"We now expect IngenioRx to achieve the upper end of our $0.70 - $0.90 guidance," Chief Executive Officer Gail Boudreaux said in a statement, referring to 2019 earnings per share contribution from the unit.

Anthem's benefit expense ratio — the percentage of premiums paid for medical services — worsened to 86.7% from 83.4% a year earlier. Analysts on average expected 86%, according to IBES data from Refinitiv. A lower benefit expense ratio is better for health insurers.

Anthem updated its 2019 forecast for the ratio to 86.2% to 86.5%, from an earlier 85.9% to 86.5% range.

Although the progress of IngenioRx is encouraging for long-term outlook, the focus is likely to remain on the benefits expense ratio underperformance and continued elevated medical costs in certain Medicaid states, Evercore ISI analyst Michael Newshel said.

Anthem shares rose 2% after the results, but quickly gave up all the gains and were down 3.5% at $292 before the bell.

On Tuesday, its rival Centene Corp warned of higher costs than previously expected this year, while UnitedHealth Group, the largest U.S. health insurer, also missed estimates for medical costs in the second quarter.

Anthem's net income rose 8% to $1.14 billion, or $4.36 per share, in the quarter ended June 30.

Excluding items, the company earned $4.64 per share, ahead of the average analyst estimate of $4.61.

Anthem raised its 2019 operating revenue forecast to about $102 billion, up from an earlier estimate of about $100 billion.

Total operating revenue rose about 11% to $25.18 billion, beating Wall Street targets of $24.87 billion, it said.

(Reporting by Tamara Mathias and Manojna Maddipatla in Bengaluru; Editing by Arun Koyyur and Tomasz Janowski)

By Tamara Mathias