Realogy, which operates many real estate businesses, including Century 21, is planning to launch an IPO soon. Just a few years ago, the company was on the verge of bankruptcy. Its comeback shows how private equity firms can rescue a company even during the worst of times and make money for themselves.

Apollo Global logo

Apollo Global Management, a private equity firm owned by Leon Black, acquired Realogy for about $7 billion in 2007. Apollo Global Management LLC (NYSE:APO) poured $2 billion of its own funds and borrowed over $6 billion, to finance the acquisition and to refinance certain debts. Apollo made that move at an extremely bad time. Apollo increased the debt burden on Realogy (remember Apollo raised $6 billion in debts to finance the deal), and the housing market was crashing.

Realogy went almost bankrupt, its turnover plunged to $4 billion in 2010, from $6.5 billion in 2006. The company was starving for cash to pay $600 million in annual interest. By 2009, Realogy had a negative cash flow. The company was kept alive on the operating table by additional borrowings. Investors avoided the company altogether, as its debts were trading at less than 10 cents per dollar. Wall Street smarts considered Apollo’s $2 billion stake worthless.

But Apollo never accepted this defeat!

Even when the death of Realogy was almost certain, Apollo Global Management LLC (NYSE:APO) publicly announced that it would put more and more money, if required, to keep the company afloat. Apollo doubled its stake in Realogy by purchasing some debts at a cheaper price. Then it tried to restructure Realogy’s debts, but hedge fund managers, including Carl Icahn, were against a restructuring plan. Carl Icahn even blocked the first restructuring plan proposed by Apollo. But finally, the private equity firm succeeded in reducing Realogy’s debt, and asked the lenders to extend the maturity of debts to 2016 or beyond. It bought Realogy sufficient time for restructuring.

Through the economic downturn, the Realogy management reduced the expenses from $6 billion in 2006 to $4.5 billion now. Over 30 percent of employees were laid off, and more than 350 brokerage offices were closed.

Today? “Realogy is now stable and its bonds are trading at par — a 900 percent return on the debt alone,” says Steven M. Davidoff, a professor at Ohio State University.

Now Apollo Global Management LLC (NYSE:APO) wants Realogy to go public, by issuing 46 million shares to raise $1.08 billion. The funds raised will be used to pay off Realogy’s debts. If Apollo pulls the IPO off successfully, Realogy will be a profitable venture with positive cash flow.

Apollo Global Management LLC (NYSE:APO) turned around Realogy when many real estate companies went bankrupt. That’s remarkable. It shows how private equity firms can make their investments worthwhile even when they make a wrong call.