After a year of transition that saw PHH Corp. (PHH) sell off its fleet management business and take a net loss from continuing operations of $191 million in 2014, PHH returned to profitability in the first quarter.

PHH reported Wednesday that it turned in net income attributable to PHH Corp. of $21 million or $0.40 per basic share in the first quarter. That’s a dramatic reversal from the first quarter of 2014, which saw PHH report a net loss from continuing operations of $58 million or $1.01 per share.

The company’s return to profitability is also a reversal of the fourth quarter, when it reported a net loss attributable to PHH Corp. of $33 million or $0.66 per basic share.

According to PHH, much of the reversal was due to its mortgage servicing segment.

The company said that its mortgage servicing segment returned a profit in the first quarter of 2015 of $57 million, compared to a segment loss of $13 million in the fourth quarter of 2014 and a segment loss of $29 million in the first quarter of 2014.

The first quarter of 2015 mortgage servicing segment profit included a $12 million favorable market-related fair value adjustment to the company’s mortgage servicing rights, and a $53 million net derivative gain related to MSRs, PHH said.

This compares to a $68 million unfavorable market-related fair value adjustment to the company’s MSRs in the fourth quarter of 2014 partially offset by a $56 million net derivative gain related to MSRs.

“During the first quarter, we continued to execute on the strategies that were established upon completion of the sale of the Fleet business in 2014,” PHH President and CEO Glen Messina said.

“We reduced our outstanding common shares by an additional 1.6 million through the successful completion of our accelerated share repurchase programs, achieved $44 million of annualized operating benefits as a result of our re-engineering actions, and signed revised agreements with clients representing approximately 50% of our 2014 total private label closing volume,” Messina continued.

“Provided that market and interest rate conditions materialize as expected, and the successful continued execution of our re-engineering actions, we anticipate reporting positive core earnings for the second half of 2015, excluding one-time items,” Messina said.

PHH reported a 27% year-over-year increase in mortgage production in first quarter of 2015.

The company said that its total first quarter 2015 mortgage closings were $9.4 billion, consistent with the fourth quarter of 2014 and up 27% from the first quarter of 2014.

Additionally, retail closings were also level with the fourth quarter of 2014 and increased 30% compared to the first quarter of 2014. Fee-based closings as a percentage of total closings continued to remain high in the first quarter of 2015, decreasing slightly to 67% of total closings from 68% of total closings in the fourth quarter of 2014 and increasing from 65% of total closings in the first quarter of 2014, PHH said.

“The high percentage of fee-based closings continues to adversely affect the profitability of our mortgage production segment as the revenue per loan on fee-based closings is generally lower than the revenue per loan on saleable closings,” PHH said in a release.

The company also reported a 46% increase in mortgage applications, rising to $15.2 billion from $10.4 billion in 1Q14.

“I am pleased with our progress to date, but we have more work to do since the achievement of meaningful and sustained profitability at our targeted return levels will require the continued successful execution of both our re-engineering and growth initiatives,” Messina said. “We are confident that the investments in our business will continue to pay off and we look forward to responding to the challenges and opportunities that lie ahead in our mortgage production and servicing businesses.”