AUGUSTA, Maine — The financial ratings company Standard & Poor’s will pay the state of Maine $21.5 million as settlement for what the state described as unfair and deceptive trade practices in connection with the housing crash that played a central role in the Great Recession.

The payment, which Attorney General Janet Mills said will arrive this spring, represents the largest lump-sum settlement in the state’s history and the second-largest overall.

Mills said the state’s lawsuit against S&P, filed in 2013, was an effort to “hold this Wall Street entity accountable” for its role in the housing bubble and the ensuing onslaught of foreclosures.

“It sends a message to Wall Street that we won’t tolerate acts that deceive investors and devastate our economy,” Mills said during a news conference on the steps of the Kennebec County Courthouse, moments after the settlement paperwork was filed.

Maine was one of 19 states, along with the federal government and the District of Columbia, that sued S&P on charges that it had defrauded investors in the lead-up to the recession. S&P recently negotiated a joint settlement worth $1.4 billion in payments — half of which will go to the federal government while the other half is divided among the states.

“That’s basically all the cash they have right now,” said Assistant Attorney General Linda Conti, who oversees the Consumer Protection Division and litigated Maine’s lawsuit against S&P.

The state alleged that S&P issued unrealistically rosy ratings of shady complex financial products that were central to the housing crisis. Many such products, including mortgage-backed securities and credit default options, were given AAA ratings — the highest offered by S&P.

“The reason they did that wasn’t because those were great investments, but because they were getting fees, essentially kickbacks from the investment banks that owned those products,” Mills said. “It encouraged banks to write mortgages that weren’t good.”

A 2011 congressional report concluded that S&P and other similar companies triggered the worst financial crisis in decades when they were forced to downgrade the inflated ratings.

S&P had argued that its credit ratings were protected by the free speech provisions of the First Amendment and argued that the federal government filed the lawsuit as retaliation for the firm downgrading the nation’s credit rating.

But under the settlement, the firm acknowledged it has not uncovered evidence to support the allegations of retaliation.

Under the deal, S&P did not admit to any violations of law, but it did sign a statement of facts acknowledging that its executives in 2005 delayed implementing new models that produced more negative ratings.

Mills said the state will use the settlement money for consumer protection and education efforts, including efforts aimed at helping homeowners facing foreclosure stay in their homes.

Follow Mario Moretto on Twitter at @riocarmine. Reuters contributed to this report.

Mario Moretto

Mario Moretto has been a Maine journalist, in print and online publications, since 2009. He joined the Bangor Daily News in 2012, first as a general assignment reporter in his native Hancock County and,...