The Wachovia Corporation announced a $23.9 billion third-quarter loss on Wednesday as it prepared to be taken over by Wells Fargo.

The bank took an $18.7 billion charge to write down the value of good will and wrote off $6.6 billion in credit losses tied largely to its disastrous purchase of Golden West Financial in 2006. And the red ink is unlikely to end soon.

Wachovia projected an additional $26.1 billion in mortgage-related losses in 2009. And it wrote down only a tiny portion of its $219 billion commercial real estate and corporate loan portfolio. Analysts expect that area to significantly deteriorate as the economy plunges into a recession.

Wachovia’s record-setting loss translated into $11.18 a share, compared with net income of $1.6 billion, or 85 cents a share, in the period a year earlier.