BOSTON -- The country’s fourth largest mortgage servicer has agreed to pay the state of Massachusetts $3.7 million to resolve claims that it failed to provide certain notices to homeowners as required by state law and that it unlawfully foreclosed on certain properties, according to state Attorney General Martha Coakley.

The assurance of discontinuance, filed in Suffolk Superior Court, alleges that national loan servicer Ocwen Financial Corporation of Atlanta failed to follow state law for notices and mortgage assessments in the handling of certain mortgage loans.

This included Ocwen’s failures to send state-mandated notices to homeowners in default, and failures to execute proper mortgage assignments, filed in the Massachusetts Registry of Deeds, as required by state law.

In addition, Litton Home Servicing Limited Partnership, a company acquired by Ocwen, allegedly initiated foreclosures when it did not hold the actual mortgages in violation of state law.

Under the terms of the settlement, $3 million will be paid to Massachusetts homeowners, and $700,000 will be paid to the commonwealth. Ocwen is also required to properly execute documents filed in connection with foreclosure proceedings, and mail notices to residents that are in compliance with applicable statutes and regulations.

In December, Ocwen, its subsidiary, Ocwen Loan Servicing LLC, and two companies it purchased, Litton and Homeward Residential Holdings LLC, entered into a $2.1 billion national settlement resulting in an estimated $80 million in principal reduction and cash payments to Massachusetts homeowners.