The plaintiffs in the case accused the two German companies, as well as U.S. firms Ford Motor and IBM, of facilitating race-based crimes by selling products such as cars and computers to South African security forces during apartheid.
U.S. District Judge Shira Scheindlin in New York said the German companies could not be sued under a 1789 law, the Alien Tort Statute, allowing non-U.S. citizens to bring cases in U.S. courts over violations of international law.
Scheindlin said the plaintiffs failed to show that the facts of the case "touch and concern the United States with sufficient force" to justify the law's use.
She declined, however, to immediately dismiss related claims against Ford and IBM.
Those companies had pushed for dismissal after a federal appeals court in August sent the case back to Scheindlin for a decision, while opining that the claims appeared "plainly barred" by a recent Supreme Court ruling.
"I think this came as a shocker to Ford and IBM," said Michael Hausfeld, a lawyer for the plaintiffs.
The plaintiffs include South Africans and family members who said they were victims of decades of race-based crimes, including torture and extrajudicial killings, by South African security during apartheid.
Apartheid ended in 1994 when South Africa held its first all-race elections, bringing Nelson Mandela and the African National Congress to power. Mandela died Dec. 5.
Both Robert Zimet, a lawyer for Rheinmettal, and Han Tjan, a spokesman for Daimler, welcomed the ruling.
"We are hopeful that this ruling will put a final end to this litigation that went on for over 10 years," Tjan said.
A lawyer for IBM declined comment. A spokesman for Ford had no immediate comment.
Scheindlin's order is the latest fallout from a U.S. Supreme Court decision that limited the ability of human rights plaintiffs to use the Alien Tort Statute to sue companies accused of improper collusion with foreign governments.
That decision, in April, in a case against Royal Dutch Shell Plc by Nigerians accusing it of complicity in violent crackdowns on protesters in the 1990s, was a victory for multi-national corporations that do business in the developing world.
Chief Justice John Roberts wrote for the majority that there is a presumption against the extraterritorial application of the Alien Tort Statute. He said the law could apply if there is enough of a U.S. connection, but that it would "reach too far to say that mere corporate presence suffices."
The ruling had immediate ripple effects, causing some other Alien Tort Statute cases to be narrowed or dismissed.
Scheindlin said it is "appropriate" to allow the plaintiffs to address the question of whether a corporation may be liable for a violation of the Alien Tort Statute.
Scheindlin said if she determines that corporations may be liable under Alien Tort Statute, the plaintiffs can seek to file an amended complaint against the remaining defendants.
The case is In re South African Apartheid Litigation, U.S. District Court, Southern District of New York, No. 02-md-1499.