The nation’s largest nonbank mortgage servicer, Ocwen Financial Corp., said Thursday that it had agreed to a $2.1 billion settlement over accusations that it had improperly handled the loans of homeowners.

The settlement with the Consumer Financial Protection Bureau and 49 states covers similar ground to a $25 billion settlement made last year with the largest banks. Ocwen, which has ridden its specialty in servicing subprime loans to become the fourth-largest mortgage servicer in the country, was not included in the larger settlement, because its nonbank status made it subject to different regulators.

Ocwen, a publicly traded company based in Florida, and all other mortgage servicers now fall under the oversight of the CFPB, which opened in 2011.

The bulk of the money, $2 billion, will go to principal reductions for people whose loans are serviced by Ocwen. An additional $125 million will be divided among people whose homes were foreclosed on by Ocwen.

The settlement covers several types of wrongdoing from 2009 to 2012 by Ocwen and two other companies it recently acquired, Litton Loan Servicing and Homeward Residential Holdings. The companies are accused of charging borrowers unauthorized fees, deceiving consumers about foreclosure alternatives and providing false or misleading information about the status of foreclosure proceedings.