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 was $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 .

GMAC said that during the quarter some businesses -- including its U.S. consumer property and casualty insurance business and some financing business in Argentina, the UK and Italy -- were classified as discontinued operations.

Excluding those businesses, its loss from continuing operations was $671 million, it said.

We continue to work through solutions for certain legacy assets, and that is still weighing on GMAC's financial performance, Chief Executive Alvaro de Molina said in a statement.

GMAC, the traditional lender to GM dealers and customers, converted to a bank holding company in December to become eligible for bailout money the U.S. Treasury was pumping into banks.

The company, which is taking over the auto loan business of Chrysler, has been reported to be in talks with the Treasury for a third infusion of government funds as GMAC approaches a deadline to implement a plan to enhance its capital.

Senate Banking Committee Chairman Christopher Dodd said on Wednesday that GMAC would receive additional bailout money from the U.S. government.

There will be an infusion, I'm told ... beyond what they have already received. But I've been assured by the administration that this is the last of it, Dodd told reporters. Asked about the size of the bailout, Dodd responded: I've heard somewhere between two and five (billion dollars).

Government stress test results issued in May showed GMAC needed to raise $11.5 billion of new capital. At the time, there was speculation that because the company had few options for raising money on its own, it might have to come back to the government.

Since then, GMAC has sold $7.4 billion in government-backed debt.

Discussions with the Federal Reserve and the U.S. Treasury have been helpful and constructive, Chief Financial Officer Robert Hull said in a conference call with analysts about the company's coming plan to shore up its capital.

Hull declined to give details.

GMAC's consolidated cash and cash equivalents fell to $14.2 billion at the end of the third quarter from $18.7 billion at June 30.

GMAC's Ally Bank net deposits grew $2.3 billion to $27.7 billion during the quarter.

(Additional reporting by Andy Sullivan in Washington; editing by John Wallace, Bernard Orr)