The Anthem Inc. Anthem Anywhere application is seen in the App Store on an Apple Inc. iPhone displayed for a photograph in Washington, D.C., U.S., on Saturday, April 21, 2018.

Anthem's first-quarter profit beat Wall Street estimates on Wednesday as it reined in expenses, and the U.S. health insurer raised its earnings forecast for the year.

Shares of the Indiana-based company rose 2.7 percent to $257.39 before the opening bell.

Last year, the health insurance sector experienced its biggest shake up in years, as rivals Aetna and Cigna closed deals with the biggest U.S. pharmacy benefits managers.

Anthem, which operates Blue Cross Blue Shield plans in 14 states, also overhauled its pharmacy benefits business after years of relying on Express Scripts to handle those operations. Its new company, IngenioRx, is expected to be launched during the second quarter with the help of CVS.

For 2019, Anthem said it expects adjusted earnings to be above $19.20 per share, higher than its prior estimate of more than $19.00.

Members in the company's health plans rose by 1.2 million to 40.8 million, helped by growth in the government business that provides Medicare health plans for people aged 65 and older and Medicaid plans for the poor.

The company gained market share across its commercial, Medicare and Medicaid businesses and its earnings forecast for the year beat the average Wall Street estimate of $19.17, implying consensus estimates will move higher, Stephens Inc analyst Scott Fidel said.

Anthem's benefit expense ratio the percentage of premiums taken in that are paid out for medical services worsened to 84.4 percent in the quarter from 81.5 percent a year earlier, partly due to a one-year waiver of the health insurance tax in 2019. Analysts on average had expected 84 percent, according to IBES data from Refinitiv.

The company said certain states in which it runs Medicaid plans saw higher medical costs.

Net income rose 18.2 percent to $1.55 billion, or $5.91 per share, in the quarter ended March 31.

Excluding items, the company earned $6.03 per share, ahead of the average analyst estimate of $5.81.

Total revenue rose 9.4 percent to $24.67 billion, beating analysts' estimates of $24.28 billion, helped by membership growth across the company's businesses and premium rate increases.