Mervyn’s, the struggling California department-store chain, is on the brink of bankruptcy, but Cerberus Capital Management has managed to wriggle out of the mess.

Unable to stock its shelves for the crucial back-to-school season, Mervyn’s is likely to file for Chapter 11 bankruptcy protection by early next week and possibly sooner, sources told The Post.

As reported by The Post on Saturday, major suppliers including Levi Strauss have stopped shipping merchandise to the midprice retailer, and big commercial lenders including CIT and GMAC have stopped financing deliveries, sources said.

But Cerberus, the giant buyout firm owned by secretive billionaire Steven Feinberg, revealed yesterday that it sold its stake in Mervyn’s in a previously undisclosed transaction late last year to Sun Capital, a Florida-based investment firm.

Cerberus, which had partnered with Sun Capital to buy Mervyn’s in 2004 from chic discounter Target for $1.2 billion, now only owns a 15 percent interest in the real-estate company that is Mervyn’s landlord, a Cerberus spokesman said.

That real-estate firm has reaped big gains by selling and leasing some Mervyn’s properties to other retailers, and more than doubled its money amid the real-estate boom in the Southwest over the past several years, sources said.

However, the sharp drop in home values across the Southwest over the past year has hit Mervyn’s shoppers hard. With sales plunging, Mervyn’s in recent weeks has withheld payments to suppliers, and Sun Capital has declined to give the retailer an equity infusion, sources said.

Mervyn’s is now in talks to obtain outside financing, including a debtor-in-possession loan to restart the flow of goods to its stores following a prospective Chapter 11 filing, sources said.