One of the most surprising aspects of the Justice Department’s five-billion-dollar lawsuit against Standard & Poor’s, which the D.O.J. accuses of defrauding investors by issuing ratings on subprime mortgage securities that it knew to be misleading, is that the settlement talks broke down. According to a story in the Times, McGraw-Hill, S. & P.’s parent company, decided to take its chances in court rather than accept a billion dollar fine and admit wrongdoing, which could have made it vulnerable to more lawsuits from investors.

McGraw-Hill did this fully aware that, in handing over some twenty million pages of e-mails to government prosecutors, it presented them with some pretty damaging stuff, including a number of messages in which S. & P. employees criticize the firm’s rating process and seemingly acknowledge that it issued generous ratings to please its customers—the Wall Street banks that issued subprime bonds—and avoid losing market share to rivals Moody’s and Fitch. In one instant message, turned over by the company and included in the government’s complaint, an S. & P. analyst says the firm would have given a good rating to a deal put together by cows.

If the case does go before a judge—the two sides could still settle before trial—S. & P. will have the opportunity to place the offending communications in context, and to counterbalance them with more exculpatory materials. But the firm also faces the risk that some of its employees, and former employees, will say incriminating things on the witness stand, and that the prosecutors could be holding even more embarrassing exhibits in reserve. The ones contained in the one-hundred-and-nineteen-page complaint are bad enough, although they don’t necessarily ensure a government victory in the case.

The case revolves around the activities of two teams at S. & P., one that rated residential-mortgage-backed securities (R.M.B.S.), and another that rated collateralized debt obligations (C.D.O.’s). The underlying collateral for both of these types of securities was largely the same: subprime mortgages taken out by borrowers who didn’t have a high enough credit rating to get a normal mortgage. The Wall Street firms that put together the securities paid S. & P. hefty fees to rate them: one hundred and fifty thousand dollars for a R.M.B.S., five hundred thousand dollars for a regular C.D.O. based on actual mortgages, and seven hundred and fifty thousand dollars for a fancy (“synthetic”) C.D.O. based on derivatives tied to the mortgages. It was a big business. Between 2005 and 2007, S. & P.’s C.D.O. division alone generated four hundred and sixty-one million dollars in revenue.

S. & P. claimed all of its ratings were independent and made in good faith, based on sound reasoning. The government claims otherwise. In particular, it makes two charges. First, between 2004 and 2007, S. & P. deliberately “limited, adjusted, and delayed” changes to its statistical models and ratings criteria for subprime securities that would have resulted in the firm issuing lower ratings. Second, between March and October of 2007, when it was perfectly clear that the housing bubble had burst, the firm “knowingly disregarded the true extent of the credit risks associated with” securities it rated.

Most of the headline-grabbing e-mails and messages come from that period in 2007, when S. & P.’s employees were tussling with data showing an “unprecedented deterioration” in the subprime-mortgage market, with loan delinquencies rising sharply. The numbers were so bad, the complaint says, that some S. & P. “analysts initially thought the data contained typographical errors.” But rather than immediately issuing a mass downgrade of lower quality mortgage bonds, which would have had a devastating impact on the C.D.O. ratings as well, S. & P. reacted slowly and cautiously, placing just a few products on a credit watch for a possible downgrade.

Internally, some of the firm’s employees were rather more explicit in their views. In March of 2007, a person identified as “Analyst D,” who had studied a series of R.M.B.S. issued in 2006, wrote an e-mail to several colleagues with the subject line “Burning Down the House—Talking Heads.” This is what it said:

Watch out

Housing market went softer

Cooling down

Strong market is now much weaker

Subprime is boi-ling o-ver

Bringing down the house Hold tight

CDO biz—has a bother

Hold tight

Leveraged CDOs they were after

Going—all the way down, with

Subprime mortgages Own it

Hey you need a downgrade now

Free-mont

Huge delinquencies hit it now

Two-thousand-and-six-vintage

Bringing down the house

A few minutes after sending this message, Analyst D followed up with another one:

For obvious professional reasons, please do not forward this song. If you are interested, I can sing it in your cube.

That same month, March, 2007, S. & P. gave investment-grade ratings to sixty-one C.D.O.’s valued at fifty-one billion dollars. In April, it rated another forty-seven C.D.O.’s valued at twenty-four billion dollars. With big investment banks like Bear Stearns and Merrill Lynch desperately trying to unload all the junk mortgages they had taken onto their balance sheets, the ratings agency was doing record business.

On April 5, 2007 two C.D.O. analysts at S. & P. had an instant-message exchange about one of the subprime issues the firm had given a sound rating, and the model used to justify that action.

Analyst 1: btw that deal is ridiculous

Analyst 2: I know right…model def does not capture half of the…risk

Analyst 1: We should not be rating it.

Analyst 2: we rate every deal…it could be structured by cows and we would rate it.

In July, 2007, following a lot of criticism in the media, S. & P. finally announced a mass downgrade. Even then, though, it continued to give investment-grade ratings to some new C.D.O.’s. On July 5th, an analyst, who was a recent hire with the firm’s structured-finance group, wrote to an investment-banking client: