Insurer Allstate posted an upbeat first-quarter profit on Wednesday, helped by higher premiums and stronger investment returns.

Insurers usually see stable product demand irrespective of economic conditions, mainly due to the widespread adoption of employer-sponsored and government-mandated policies.

First quarter net income applicable to common shareholders was $1.2 billion compared to a net loss of $346 million a year ago during the same period.

Allstate’s adjusted first-quarter swung to a profit of $5.13 per share in the three months ended March 31 from a loss of $1.30 per share in the year ago quarter. Analysts on an average estimated the company to post a profit of $3.94 per share, according to LSEG data.

The company’s consolidated premiums written for the quarter were at $14.29 billion, up 11.1% from the year-ago quarter.

Allstate’s investment income, on the other hand, rose to $764 million in the quarter from $575 million in 2023, mostly on the back of higher market-based and performance-based income.

The Northbrook, Illinois-based company posted an underlying combined ratio of 86.9, compared to 93.3 a year earlier. A ratio below 100 means the insurer earned more in premiums than it paid out in claims.

The insurer’s catastrophe losses in the quarter fell 56.8 percent to $731 million.