NEW YORK — GMAC Financial Services said it posted a loss in the first quarter, as gains by its automotive finance and insurance businesses could not overcome bleak results from its mortgage unit.

Analysts said the loss did not bode well for automaker General Motors Corp., the former parent of GMAC, ahead of that company's earnings report.

The lender, in which GM still holds a 49 percent stake, reported a quarterly loss of $305 million, compared with a profit of $495 million during the same period last year.

GMAC said income from its global automotive finance business

more-than doubled to $396 million from $186 million during the same period a year ago, while income from its insurance group advanced 11 percent to $143 million from $129 million.

But its mortgage unit, Residential Capital LLC, swung to a loss of $910 million, compared with a profit last year of $211 million. GMAC cited "difficult market conditions," particularly for the nonprime, or subprime, mortgages it held during the quarter.

As the housing market cooled in recent quarters, payment defaults have mounted, especially on riskier nonprime mortgages. That has made it tougher for lenders to sell the loans at a profit. GMAC said the nonprime loans Residential Capital placed for sale in the quarter were either sold or priced below market values.

GMAC also said Residential Capital put more money aside during the quarter to cover subprime loans at greater risk for delinquency or outright loss, and incurred losses from its relationships with other participants in the subprime market.

GMAC's Chief Executive Eric Feldstein said the company has taken steps to make the mortgage unit less vulnerable to future difficulties in the nonprime segment.

"ResCap has reduced its nonprime mortgage asset portfolio, decreased its warehouse lending against nonprime collateral, and sharply curtailed its new domestic nonprime loan production," Feldstein said in a statement.

GMAC expects Residential Capital's performance will improve second quarter, with fewer losses in its U.S. residential mortgage operations.

"In the wake of a sharp mortgage market downturn, ResCap has incurred a setback," Feldstein said. "But this setback is expected to be a temporary one."

The mortgage unit remains well capitalized, GMAC said, noting that General Motors injected $1 billion into the unit during the quarter to bring Residential Capital's equity base to $7.2 billion.

Factors driving performance at GMAC's automotive finance unit during the quarter included improved margins in North America and gains on loan sales. The group's earnings gain came despite little year-over-year improvement in new vehicle retail and lease originations. The unit also set aside less money for taxes.

On the insurance side of the business, GMAC said higher earned premiums and fewer losses drove its performance.

General Motors spun off a majority piece of GMAC in November, but still owns a big share of the company. GM reports its earnings on Thursday and analysts think its automotive operations will need a big quarter to overcome GMAC's loss.

"GM's auto operations will likely need to be better than expected for GM to meet estimates," said Jonathan Steinmetz, an analyst at Morgan Stanley, in a note to clients on Wednesday.

Analysts polled by Thomson Financial expect a first-quarter profit from GM of 87 cents per share.

Shares of General Motors rose $1.61, or 3.7 percent, to $32.46 on Wednesday. The stock has traded in a 52-week range of $22.29 to $37.24.