In a first-of-its-kind enforcement action, the Consumer Financial Protection Bureau this week ordered Flagstar Bank to pay $37.5 million to resolve charges that the bank engaged in illegal mortgage servicing practices.

In a statement, CFPB Director Richard Cordray said the enforcement action represents the first under the agency’s new mortgage servicing rules, which took effect in January 2014. “These new regulations establish specific rules of the road for handling loss mitigation applications,” Cordray said. “Since we first announced these rules almost two years ago, we have made clear that we expect full compliance,” he said, adding that the action “signals a new era of enforcement.”

As part of the CFPB’s order, Flagstar must pay $27.5 million to consumers whose loans were being serviced by Flagstar, and who were subject to its unlawful practices. At least $20 million of this amount will go to victims of foreclosure. Flagstar must also engage in outreach to effected borrowers who were not foreclosed on, offer them loss mitigation options, and halt any current foreclosure activity during this outreach and qualification process. The bank will also pay $10 million to the CFPB’s Civil Penalty Fund.

“Flagstar took excessive time to process borrowers’ applications, did not tell them when their applications were incomplete, denied loan modifications to qualified borrowers, and illegally delayed finalizing permanent loan modifications,” Cordray stated.

According to the CFPB’s investigation, Flagstar was not equipped to handle the influx of applications for loss mitigation that it had received as a result of the foreclosure crisis. For example, in 2011, Flagstar had 13,000 active loss mitigation applications, but had only 25 full-time employees and a third-party vendor in India reviewing them.

Additionally, the CFPB discovered that when Flagstar did evaluate a completed application, it did a poor job. For example, it routinely miscalculated the incomes of borrowers, leading to wrongful denials of loan modifications, according to the CFPB.

When Flagstar denied an application, it didn’t give homeowners a specific reason why, which is in direct violation of the CFPB’s new mortgage servicing rules. “This gives consumers a chance to fix the problem and either reapply or appeal the rejection,” Cordray said. “It also gives consumers more control over what is happening and provides them with critical information so they can make informed choices.”

Another new mortgage servicing right for certain homeowners is the right to appeal the denial of a loan modification. Flagstar violated this right by wrongly telling borrowers that they only have the right to appeal if they live in certain states.

For consumers that did receive a trial loan modification, Flagstar kept them in “purgatory,” Codray stated, by needlessly prolonging trial periods. This caused some borrowers’ loan amount under the modified note to increase and, in some cases, jeopardized the potential for a permanent loan modification.