NEW YORK - Standard & Poor's is paying about $1.38 billion to settle government allegations that it knowingly inflated its ratings of risky mortgage investments that helped trigger the financial crisis.

S&P's parent company, McGraw Hill Financial (MHFI), announced the deal with the Department of Justice on Monday before financial markets opened in the U.S. The settlement, which covers ratings issued from 2004 through 2007, also resolves lawsuits filed by the attorneys general of 19 states and the District of Columbia.

Attorney General Eric Holder is scheduled to announce the settlement later this morning.

Get Breaking News Delivered to Your Inbox

The credit rating agency's agreement represents one of the government's key efforts to hold accountable market players deemed responsible for contributing to the worst financial crisis since the Great Depression. The settlement announced Tuesday came after months of negotiations.

The Justice Department filed civil fraud charges against S&P two years ago this week. It accused the company of failing to warn investors that the housing market was collapsing in 2006 because doing so would hurt its ratings business.

The Justice Department had demanded $5 billion in penalties from S&P when it sued the company in February 2013. The payment of about $1.38 billion to settle the case is less than S&P's revenue in 2013 of $2.27 billion.

Under terms of the settlement, S&P will pay $687.5 million to the DOJ and $687.5 million to the states and District of Columbia.

The three big rating agencies - S&P, Moody's Investors Service and Fitch Ratings - have been blamed for helping fuel the 2008 crisis by giving high ratings to high-risk mortgage securities. The high ratings made it possible for banks to sell trillions of dollars' worth of those securities. Some investors, such as pension funds, can only buy securities that carry high credit ratings.

Those investments soured when the housing market went bust in 2006.

Experts say the Justice Department's lawsuit against S&P could serve as a template for action against Fitch and Moody's.

S&P disputed the government's allegations when the federal suit was filed, calling the legal action "meritless" and the claims "simply not true." The company insisted its ratings were based on a good-faith assessment of the performance of home mortgages during a time of market turmoil.

Last month, S&P agreed to pay the federal government, New York state and Massachusetts more than $77 million to settle separate charges by the Securities and Exchange Commission related to its ratings of high-risk mortgage securities after the crisis. The SEC had accused S&P of fraudulent misconduct, saying the company loosened standards to drum up business in 2011 and 2012.

S&P neither admitted nor denied the charges in the settlement.

S&P also announced Tuesday that it will pay $125 million in a separate settlement with the California Public Employees' Retirement System to resolve its claims against the company regarding ratings on three structured investment vehicles. The settlement is not subject to judicial approval.