Illinois will receive $19.5 million from Moody’s Investors Service to resolve a federal investigation into its ratings of mortgage securities leading up to the 2008 financial crisis.

The credit rating firm agreed to pay $864 million to settle with the U.S. Justice Department and 21 states that accused the company of inflating ratings on risky mortgage securities and contributing to the economic collapse, according to a news release from Illinois Attorney General Lisa Madigan’s office.

“Moody’s conduct directly contributed to our country’s economic collapse,” Madigan said in the statement on Friday. “Moody’s did not do its job and lured state pension funds into risky mortgage-backed securities.”

The settlement alleges that Moody’s consistently misrepresented its process for assigning credit ratings to structured finance securities and privately relaxed its ratings criteria to ensure its clients received higher ratings, according to the statement. It states that the alleged misconduct began in 2001 and grew “particularly rampant” from 2004 to 2007.

Moody’s also agreed to provide a detailed statement of facts about how it assigned ratings leading up to the financial crisis and to comply with significant terms, including an annual certification by the corporation’s CEO, according to the statement.

“The agreement acknowledges the considerable measures Moody’s has put in place to strengthen and promote the integrity, independence and quality of its credit ratings,” the company said in a statement Friday.