Merrill Lynch & Co. (MER) said late Wednesday that it lost $4.65 billion during the second quarter, as it was clobbered by $9.7 billion in total write-downs, tied mostly to the battered mortgage market. The results mark one of the worst quarters in the financial company's history. The continuing losses -- Merrill has now seen write-downs of roughly $40 billion in the past four quarters -- led the Wall Street giant to sell off its stake in Bloomberg LP for $4.4 billion; the company also announced Thursday its plan to sell Financial Data Services Inc., valued at $3.5 billion. Moody's Investors Service quickly downgraded the debt ratings of the ailing Wall Street giant on the news of much larger than expected losses, moving ratings from A1 to A2. The agency said it expects up to an additional $10 billion in pre-tax writedowns; anything above that would further pressure ratings. The agency also took pains to note "the vulnerability of the secured funding model of Merrill Lynch and other investment banks to overall market liquidity," citing the failure of Bear Stearns as an example. "When market liquidity dries up, collateral becomes harder to value, margin disputes arise, and pressure on an investment bank's funding increases," Moody's said in its press statement. A look at mortgages Merrill continued to dive into the luxury home market during the quarter, as net exposures to U.S. prime residential mortgages increased 10 percent to $33.7 billion on strong originations from Merrill subsidiary First Republic Bank. First Republic specializes in ultra-high net worth mortgage originations in the luxury home market, primarily in California. All other residential mortgage-related exposures, including subprime and Alt-A, fell by an aggregate 25 percent during the quarter. Subprime mortgage-related exposures dropped 29 percent to $1.0 billion, primarily due to $544 million in markdowns, Merrill said. Alt-A exposure declined 51 percent to $1.5 billion, due to sales of $1.1 billion and net losses of $549 million -- which means Merrill was among the active sellers during the second quarter in the growing distressed mortgage market. HW's sources had suggested as much in recent weeks. The Wall Street firm held total exposure to mortgages of roughly $43.7 billion at the end of the second quarter, essentially unchanged from one quarter earlier. While direct mortgage exposure remained essentially flat overall, Merrill clearly took a huge Alt-A hit in its MBS investment portfolio -- to the tune of $1.38 billion in non-temporary impairment charges (so-called "non-temporary" marks flow directly through to a company's income statement). In fact, the non-temporary marks to the company's prime MBS holdings actually exceeded the marks to subprime-backed securities, at $211 million and $91 million in write-downs, respectively. Taken together, it's clear that the mortgage maelstrom has moved largely out of subprime -- although not completely -- and into Alt-A and prime mortgages. Disclosure: The author held no direct positions in MER when this story was written, although indirect holdings may exist via mutual fund investments. HW reporters and writers follow a strict disclosure policy, the first in the mortgage trade.