A Manhattan law firm that represents creditors has agreed to pay more than $650,000 to settle a New York investigation that it filed frivolous lawsuits in housing court matters that were already resolved, the state attorney general’s office said Wednesday.

The settlement requires Tromberg, Morris & Poulin to pay $595,600 in restitution to more than 4,000 New Yorkers, and $60,000 in penalties to New York State.