The company also reported higher-than-expected third quarter profit as it reined in costs.

"We're entering 2019 in a position of strength," Chief Executive Officer Gail Boudreaux said on a conference call with analysts. Current 2019 consensus estimates for core earnings are "slightly below" Anthem's long-term high-single to low-double digit growth target, she added.

Wall Street is forecasting adjusted earnings of $17.13 per share for 2019, according to Refinitiv data.

"I think people are reacting to the comments on next year's outlook," Credit Suisse analyst A.J. Rice said of the share price bump. "I still think there's some level of conservatism baked in. They tend to be conservative."

Anthem's benefit expense ratio for the quarter - its spending on claims against premiums earned - narrowly missed consensus estimates of 84.7 percent compiled by Evercore ISI.

It did improve to 84.8 percent from 87 percent last year, and Anthem now expects around 84.2 percent for 2018, an improvement from its prior forecast of 84.4.

As the health insurance industry focuses on tightening spending, Anthem's rivals Aetna Inc and Cigna Corp have signed multibillion-dollar deals to merge with pharmacy benefit managers.

Anthem has decided to take its pharmacy benefits business in-house in 2020, when it will start managing billions of dollars of patient prescriptions under its IngenioRx brand in a bid to cut costs.

The company expects to save $4 billion a year as a result and said it will return about 20 percent to shareholders.

Membership in Anthem's health plans fell by 753,000 from 40.3 million a year ago as it continues to exit its Obamacare business and lost out on members buying its Medicaid health plans for low-income customers.

"This appears to be a transient headwind," Leerink analyst Ana Gupte said.

The Medicare business, which caters to seniors and people with disabilities, rose nearly 18 percent to 1.77 million, boosted by acquisitions.

Anthem now expects full-year adjusted earnings of over $15.60 per share, up from a prior forecast of over $15.40.

Excluding items, the company earned $3.81 per share, beating analysts' estimates by 11 cents.

Total revenue rose 3.7 percent to $23.25 billion, exceeding the Wall Street forecast of $22.94 billion.

Anthem shares were up 1.6 percent at $269.68 after earlier climbing as high as $279.15.

(Reporting by Aakash Jagadeesh Babu and Tamara Mathias in Bengaluru and Caroline Humer in New York; Editing by Arun Koyyur and Bill Berkrot)

By Tamara Mathias and Aakash B