Standard & Poor’s agreed to pay $19 million and halt part of its commercial-mortgage bond business for a year to settle claims by two states that it altered its criteria for rating eight deals to win business.

S&P agreed to settle with New York and Massachusetts over claims the firm made $7 million in fees on six deals in 2011 after loosening standards for calculating the debt-service coverage ratio, New York Attorney General Eric Schneiderman said in a statement Wednesday. S&P misled investors into thinking that the deals were graded by more stringent criteria, according to the statement. The agreement also calls for S&P to give up $7 million in disgorgement.