GMAC Financial Services, a lender that has received $12.5 billion in government bailouts, posted a third straight quarterly loss on Wednesday, hurt by red ink in its mortgage business.

The third-quarter net loss for Detroit-based GMAC totaled $767 million, compared with a loss of $2.5 billion a year earlier.

GMAC's auto finance unit had a profit of $395 million in the quarter, while its mortgage operations posted a loss of $747 million.

The lender has struggled as the deteriorating auto and housing markets have caused financing volume to decline and credit losses to increase. GMAC's owners include automaker General Motors and the private equity firm Cerberus Capital Management LP .

(Reporting by Juan Lagorio; editing by John Wallace)