PHH Corp. (PHH) went deep into the red in the second quarter.

PHH announced Wednesday that it was posting a net loss attributable to PHH Corporation of $62 million, or $1.20 per basic share, in the second quarter.

The loss was driven primarily by PHH setting aside a $34 million pre-tax provision for legal and regulatory reserves.

In May, PHH actually posted a profit, reporting a net income attributable to PHH Corp. of $21 million or $0.40 per basic share in the first quarter. That was 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.

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.

But those results were completely reversed in the second quarter, contributing to PHH’s rough showing.

The company reported that its mortgage servicing segment posted a loss in the second quarter of $46 million, compared to a segment profit of $10 million in the second quarter of 2014.

The servicing segment loss for the second quarter of 2015 included a $69 million favorable market-related fair value adjustment to the company’s mortgage servicing rights, partially offset by a $49 million net derivative loss related to MSRs.

The $69 million favorable market-related fair value adjustment was primarily attributable to a 36 basis point increase in the modeled mortgage rate.

The sequential quarter decline in segment results was also driven by an increase in total expenses primarily resulting from a $34 million provision for legal and regulatory matters and a $6 million provision for certain non-recoverable fees associated with foreclosure activities that were incurred during the second quarter of 2015, the company said.

“One year ago we completed the sale of our fleet business and presented a strategic plan to revise our capital structure, re-engineer our business and position the company for growth,” Glen Messina, president and CEO of PHH Corporation, said.

“We have continued to execute on these strategies during the second quarter of 2015 through the substantial conclusion of our private label contract renegotiations and the achievement of nearly 50% of our annualized targeted re-engineering benefits,” Messina said. “While we have made good progress on our re-engineering activities, we have more work to do.”

Messina said that the company expects to return to profitability in 2016, but provides some caution on the immediate future.

“We have encountered delays in executing our strategies to drive organic growth and our servicing segment continues to operate at a loss,” he said.

“Provided market and interest rate conditions materialize as expected and we successfully complete our strategic initiatives, we expect core earnings before one-time items to improve from the second quarter levels and approach break-even for the second half of the year,” Messina said.

“As we reflect on the many accomplishments over the past year, we are ever mindful of the dynamic regulatory climate and the uncertainty it creates regarding the potential consequences of legacy practices,” Messina said.

“In light of these regulatory uncertainties, the volatile nature of our industry and our need to increase scale to meet our return objectives, we currently believe it is prudent to conserve our liquidity, and have elected to delay our board-authorized share repurchase program,” he added.

“We remain committed to executing a capital deployment framework to achieve our long-term return objectives and will continue to evaluate our overall capital structure and liquidity position as we progress,” Messina concluded.