MGIC Investment Corp., the largest U.S. mortgage insurer, reported a smaller than expected first quarter loss, sending its shares up more than 20 percent.

MGIC lost $34.4 million, or 41 cents per share, compared a net income a year earlier of $92.4 million, or $1.12 a share.

The results were better than analyst estimates of $1.69 per share, according to Thomson Financial.

Shares in the Milwakee-based firm rose $2.03, or 19.33 percent to $12.53 in late afternoon trading.

Revenue rose 14.7 percent to $423.9 million, but fell short of estimates.

The insurance firm has been hurt by the ongoing housing downturn.

The firm lost $1.47 billion in the fourth quarter and $372.5 million the third quarter.

The company said it would reduce coverage in California and Florida to limit the cost of reimbursing borrowers there.