GM won't face lawsuits stemming from problems tied to its deadly ignition switch, a federal bankruptcy judge in New York ruled late Wednesday.

The decision by Federal Bankruptcy Court Judge Robert Gerber upholds GM's so-called bankruptcy shield. GM acquired the shield as part of its bankruptcy reorganization when a new company was created in 2009, referred to in court as "New GM."

"Judge Gerber properly concluded that claims based on Old GM's conduct are barred," the automaker said in a statement.

The shield had been challenged both by some personal injury attorneys as well as lawyers suing on behalf of owners of the recalled cars to recover damages for the diminished value of the recalled cars.

The decision could prevent lawsuits that would have cost "New GM" billions of dollars.

"This ruling padlocks the courthouse doors," said Robert Hilliard, one of the attorneys suing GM. "Hundreds of victims and their families will go to bed tonight forever deprived of justice. GM, bathing in billions may now turn its back on the dead and injured, worry free."

The decision left the possibility for some suits to proceed if the plaintiffs can prove misdeeds by the company after the 2009 bankruptcy, "so long as those plaintiffs' claims do not in any way rely on any acts or conduct by old GM."

GM (GM) shares were up about 1% in after-hours trading following the decision.

Problems with millions of cars with faulty ignition switches, most of them built before the bankruptcy, have been tied to at least 84 deaths. It is not immediately clear how many of the accidents occurred after the bankruptcy. Accidents that occurred in the years following 2009 were not protected by the shield.

GM has admitted that its employees were wrong not to order a recall of the cars about a decade before the 2014 recall.

The decision will not stop GM from paying an estimated $400 million to victims and their family members. But GM set up a compensation fund voluntarily without waiving the legal protections it acquired as part of the bankruptcy process on pre-2009 accidents.