![standard & poor's](https://i2.cdn.turner.com/money/dam/assets/150202173347-standard--poors-780x439.jpg)
Standard & Poor's has agreed to pay $1.37 billion to settle charges that it issued inaccurate credit ratings on investments tied to subprime mortgages before the financial crisis.
The settlement comes nearly two years after the Department of Justice first accused S&P of giving top ratings to poor quality mortgage-backed securities between 2004 and 2007. According to the lawsuit, S&P gave the deceptive ratings so it could collect fees from the financial firms that sold the securities.
S&P said Tuesday the settlement also resolves lawsuits with attorneys general in 19 states and the District of Columbia. Under the terms of the agreement, half of the settlement amount will be paid to the states and the other half will go to the federal government.
Separately, S&P will pay $125 million to California's public pension fund to resolve claims that it was misled in three separate transactions.
Last month, S&P paid $58 million to the Securities and Exchange Commission and another $19 million to settle similar charges with the attorneys general in New York and Massachusetts.
S&P said the latest settlement "contains no findings of violations of law by the company."
However, federal prosecutors said the company has acknowledged the "improper conduct that led to this settlement."
The suit was the first federal action against one of the country's major ratings agencies, which have long been cited as key culprits in the real estate-fueled financial meltdown.
S&P had initially argued that the lawsuit lacked merit and suggested that the government was acting in retaliation for downgrading the United States credit rating in 2011.
Attorney General Eric Holder said the claim was "utter nonsense," adding that the DOJ submitted millions of documents and that no indication of retaliation was found.
Related: Countrywide whistleblower gets $57.6 million
Ratings matter to investors who rely on the agencies to analyze risk and give debt a "grade" that reflects a borrower's ability to repay loans. The safest investments are rated "AAA."
In the years preceding the 2008 financial meltdown, a large numbers of securities received AAA ratings even though they were backed by risky mortgages.
Pension funds and insurance companies, which invest billions of dollars, are required to hold a certain percentage of highly rated securities in their portfolios. These funds bought gobs of the top-rated securities, not knowing that they were actually of poor quality.
Related: Subprime mortgages making a comeback
Those mortgage-backed securities paid investors well when housing prices were going up and borrowers could sell their homes at a profit. But as the housing bubble burst, foreclosures soared and the value of the securities plunged.
Federal prosecutors said they identified more than $5 billion in losses from just one set of securities that were rated by S&P between March and October of 2007.
Federal investigators are now reportedly turning their sights on Moody's, the No. 2 ratings agency.
-- CNNMoney's Chris Isidore contributed to this report.