Chubb beat estimates for quarterly profit on Tuesday as higher returns from its investments cushioned a hit from catastrophe-related claims.

Investment income, which had slumped for most insurance firms that invest a chunk of their profits across classes, has recovered this year as markets rally. The benchmark S&P 500 Index .SPX has risen about 18 percent year-to-date.

NYSE-listed shares of the insurer rose 3.09 percent in extended trading, after results.

Chubb’s core operating income rose to $2.04 billion, or $4.92 per share, for the quarter ended June 30, from $1.79 billion, or $4.22 a piece, a year ago.

The Zurich-based company also benefited from strong underwriting activity in the quarter, with net premiums written climbing 16.1 percent, to $11.95 billion, from last year.

“Our investment income run rate will continue to grow as we reinvest cash flow at higher rates and compound income,” Chairman and CEO Evan Greenberg said in a statement.

Chubb’s pre-tax net investment income rose about 30 percent from last year, to $1.14 billion.

Analysts on an average had expected a profit of $4.41 per share, according to Refinitiv IBES data.

The company reported a current accident year combined ratio, excluding catastrophe losses, of 83.1, compared with 83.4 a year earlier. A ratio below 100 means the insurer earned more in premiums than it paid out in claims.

The upbeat results helped cushion higher catastrophe-related claims due to severe storms and hail in several parts of the U.S. during the quarter.

Extreme weather across the U.S. caused the insurer’s catastrophe losses net of reinsurance to jump to $400 million, from $291 million a year earlier.

(Reporting by Pritam Biswas in Bengaluru; Editing by Pooja Desai)