In the wake of a lawsuit filed by the Massachusetts attorney general, GMAC Mortgage, a subsidiary of Ally Financial, said on Friday that it would stop buying mortgage loans in the state after Dec. 5.

Massachusetts targeted GMAC, along with Bank of America, JPMorgan Chase, Citigroup and Wells Fargo for allegedly deceptive foreclosure practices, including robo-signing and false documents.

GMAC Mortgage has taken this action because recent developments have led mortgage lending in Massachusetts to no longer be viable, GMAC said in a statement, citing higher prices.

The suit came while major banks are negotiating with all 50 states on a settlement for mortgage irregularities. The government's Federal Housing Finance Agency and Federal Housing Administration have also targeted major lenders for allegedly deceptive practices relating to mortgage securities.

The other banks targeted by the Massachusetts lawsuit all said they would defend the claims. Their stocks seemed relatively unaffected on Thursday.