CVS Health swung to a profit in its fourth quarter, as the year-ago period was weighed down by a goodwill impairment charge.

CVS Health Corp. earned $1.74 billion, or $1.33 per share, for the three months ended Dec. 31. A year earlier the Woonsocket, Rhode Island, drugstore chain lost $421 million, or 37 cents per share.

Removing certain items, earnings were $1.73 per share, the company said Wednesday.

Revenue climbed to $66.89 billion from $54.42 billion.

Analysts polled by FactSet expected a profit of $1.68 per share on revenue of $63.93 billion.