According to the lawsuit, S&P didn't issue a mass downgrade of subprime-backed securities until mid-2007, even though it knew in 2006 that many borrowers were struggling or failing to make payments.
The mortgages were faring so poorly "that analysts initially thought the data contained typographical errors," according to the lawsuit.
In a 2007 email, another analyst said some at S&P wanted to downgrade mortgage investments earlier, "before this thing started blowing up. But the leadership was concerned of p(asterisk)ssing off too many clients and jumping the gun ahead of Fitch and Moody's."
The complaint includes a trove of embarrassing emails and other evidence that S&P analysts recognized the market's problems early.
In 2007, for example, an analyst who was reviewing mortgage bundles forwarded a video of himself singing and dancing to a song written to the tune of "Burning Down the House": "Going — all the way down, with/Subprime mortgages." The video showed colleagues laughing at his performance.
Critics have long argued that the rating agencies operate with a conflict of interest: They're paid by the banks that create the investments they're rating. If one agency appeared too strict, banks could shop around for a better rating.
S&P typically charged up to $150,000 for rating a subprime mortgage-backed security and up to $750,000 for certain other securities, the lawsuit says. If S&P lost the business to Fitch or Moody's, its main rivals, the analyst who issued the rating would have to submit a "lost deal" memo explaining why he or she lost the business.
An analyst complained in 2004 that S&P had lost a deal because its standards for a rating were stricter than Moody's. "We need to address this now in preparation for the future deals," the analyst wrote.
The documents "make clear that the company regularly would 'tweak,' 'bend,' delay updating or otherwise adjust its ratings models to suit the company's business needs," said acting Associate Attorney General Tony West.
S&P countered that the emails were "cherry picked," that they were "taken out of context, are contradicted by other evidence, and do not reflect our culture, integrity or how we do business."
It said analysts' concerns were addressed before a rating was issued and that the government left out important context.
The ratings "reflected our current best judgments," S&P said in its statement. It noted that other agencies gave the same high ratings and said the government also failed to predict the subprime mortgage crisis.
The lawsuit comes just 18 months after S&P cut its rating on long-term U.S. government debt by a notch. The downgrade followed a contentious debate between the White House and Congress over the raising of the government's borrowing limit that was resolved at the last hour.
Holder was asked about a possible link between the lawsuit and the downgrade.
"There's no connection," Holder said. He added that the department's investigation began in 2009.
But Michael Robinson, a former communications official at the SEC, said that while all three major rating agencies have lost credibility since the financial crisis, S&P's downgrade of U.S. debt put a bull's-eye on its back.
"Once you get on the government's radar, it's hard to get off scot-free," Robinson said.
The government charged S&P under a law intended to make sure banks invest safely. If S&P is found to have committed civil violations, it could face not only fines but also limits on how it does business.
McGraw-Hill shares closed down nearly 11 percent Tuesday. On Monday, after the lawsuit was first reported, they plunged nearly 14 percent.
Shares of Moody's Corp., the parent of Moody's Investors Service, another rating agency, lost nearly 9 percent Tuesday after closing down nearly 11 percent Monday.
Christina Rexrode reported from New York. AP writers Pete Yost and Marcy Gordon in Washington and AP Business Writer Bree Fowler in New York contributed to this report.
Daniel Wagner can be reached at www.twitter.com/wagnerreports .