ST. LOUIS (AP) — Utility company Ameren moved to a loss in its fourth quarter as it dealt with hefty impairment charges.

The St. Louis company lost $1.16 billion, or $4.76 per share, for the three months ended Dec. 31. That compares with a profit of $25 million, or 10 cents per share, in the prior-year period.

Stripping out charges totaling $4.84 per share that include a writedown in its merchant generation business, which it intends to exit, and other items, earnings were 14 cents per share. Analysts surveyed by FactSet forecast 20 cents per share.

Ameren said Wednesday that its quarterly performance was hampered by a decline in earnings at Ameren Illinois and a drop in earnings at its merchant generation unit. This was mostly offset by higher earnings at Ameren Missouri.

Operating revenue fell 4 percent to $1.51 billion from $1.58 billion.

For the year, Ameren Corp. lost $974 million, or $4.01 per share. In the previous year the company earned $519 million, or $2.15 per share.

Adjusted earnings were $2.42 per share.

Annual operating revenue declined 9 percent to $6.83 billion from $7.53 billion.

Looking ahead, Ameren foresees 2013 adjusted earnings between $2 and $2.20 per share.

Analysts forecast earnings of $2.11 per share.

The company's shares gained 63 cents to $33.87 in afternoon trading.