Despite softer home sales, Lennar (LEN) revealed on Tuesday a first-quarter profit over a year ago loss on improvements in its distressed real estate business. 

The company posted net earnings of $27.4 million, or 14 cents a share, compared with a loss of $6.5 million, or 4 cents a share, in the same quarter last year, widely ahead of average analyst estimates polled by Thomson Reuters of a 5-cent loss.

Revenue was $558 million, down 3% from $574.4 million a year ago, beating the Street’s view of $508.23 million.

Lennar, one of the nation’s largest homebuilders, saw significant improvements in its Rialto Investments segment, which invests in distressed real estate, offset by a drop in homebuilding sales to $466.7 million from $520.7 million the year-earlier period. 

The company has struggled to widen its profit since the expiration of a federal tax credit for home buyers last year. A weak economic environment has kept unemployment high and consumers afraid of purchasing new homes. 

Despite the weaker sales, though, the company’s homebuilding segment still improved operating earnings by a whopping 550%. Lennar's chief executive, Stuart Miller, said the organization is pleased with the results, which mark its fourth consecutive quarter of profitability.

Follow Jennifer Booton on Twitter at @Jbooton