CVS Health rode double-digit sales growth from drugstores and its pharmacy benefits management business to a better-than-expected third quarter.

The health-care giant also hiked its 2025 forecast well above Wall Street estimates.

Overall, the company said it lost nearly $4 billion in the third quarter, including a nearly $6 billion charge for scaling back the Oak Street Health clinic business it bought two years ago. Yet total revenue grew almost 8 percent to $102.9 billion.

Adjusted earnings came in at $1.60 per share. Analysts had expected earnings of $1.37 per share on $98.81 billion in revenue, according to the data firm FactSet.

CVS Health Corp., based in Woonsocket, R.I., operates one of the nation’s largest drugstore chains and a huge pharmacy benefit management business that operates prescription drug coverage for employers, insurers and other big clients. It also covers nearly 27 million people through its Aetna insurance arm.

The company now expects adjusted earnings to range from $6.55 to $6.65 this year. That’s a hike of 25 cents per share on both ends from a forecast it made in July.

Analysts expect annual adjusted earnings of $6.38 per share.