GMAC LLC, the auto and home lender that received a $6 billion government bailout, posted its first profit in six quarters Tuesday, after recording gains from a debt swap that helped avert default. The two operating units had losses.

The Detroit company swung to a fourth-quarter profit of $7.46 billion from a loss of $724 million a year earlier. Extinguishing debt in the bond exchange produced an $11.4 billion gain.

The auto finance unit swung to a $1.31 billion loss from a $137 million profit, and the home lending arm's loss widened to $981 million, from $921 million a year earlier.

In December GMAC won permission from the Federal Reserve Board to become a bank holding company and gain access to funds from the Treasury Department's Troubled Asset Relief Program as part of an effort to save General Motors Corp., which owns a minority stake in the lender. In the five previous quarters, GMAC racked up $7.9 billion of losses as tumbling home prices increased foreclosures at its mortgage unit.

"Their mortgage business is basically closed and auto sales are in free fall," said Mirko Mikelic, who helps manage $19 billion at Fifth Third Asset Management in Grand Rapids. The bailout "may keep them around at least until they need to restructure," said Mr. Mikelic, whose firm owns GMAC and GM debt.

Residential Capital LLC, GMAC's home finance business, posted its ninth straight quarterly loss. After raising doubts about the unit's ability to survive in its third-quarter report in November, GMAC said in December that the federal bailout would allow ResCap to continue making home loans.

Subscribe Now

Access to authoritative analysis and perspective and our data-driven report series.

14-Day Free Trial

No credit card required. Complete access to articles, breaking news and industry data.