Home and auto insurer Allstate Corp swung to a profit in the second quarter, smashing recently lowered Wall Street expectations, after its disaster losses were less than half of the record-breaking level they hit last year.

Shares rose 3.6 percent to $35.53 after hours from a $34.30 close.

Earlier this month, the largest publicly traded home and auto insurer in the United States, said its second-quarter disaster losses were $820 million, roughly a third of what they were after devastating tornadoes in the second quarter of 2011.

Allstate reported a net profit of $423 million, or 86 cents per share, compared to a year-earlier loss of $624 million or $1.19 per share.

On an operating basis, the company earned 87 cents per share. Analysts polled by Thomson Reuters I/B/E/S had expected on average, earnings of 51 per share.

As the scope of catastrophe losses in the second quarter became clear, analysts sharply lowered their forecasts. One month ago, the Street average earnings estimate was 90 cents per share.

Allstate, which has been on a campaign to shed unprofitable business and improve margins, said premiums written grew nearly 4 percent in the quarter over a year earlier.

Overall policies in force fell 0.6 percent from the end of last year, as the company’s other brands grew but could not offset declines in Allstate-branded home and auto policies.