Environmentalists took their case to the Ninth Circuit Court of Appeals, which upheld the lower court's decision in February.
But the government then petitioned the Supreme Court.
In Wednesday's ruling the Supreme Court found the lower court had exceeded its authority in telling the navy to reduce sonar levels.
However, environmentalists rejoiced that it did not rule on other measures such as the need to respect a protective zone off the California coast.
Environmental impact
"The court did not upset the underlying determination that the Navy likely violated the law by failing to prepare an environmental impact statement," said Joel Reynolds, a lawyer for the National Resources Defence Council (NRDC).
Two dissenting judges on Wednesday insisted that while there was "no doubt that the training exercises serve critical interests ... those interests do not authorise the navy to violate a statutory command."
Dissenting judge Ruth Ginsburg further said the navy had failed to obey the law by not supplying a full report on the environmental risks before beginning to use sonar, and just sticking to its preliminary report.
At the start of the Supreme Court hearing in October, government lawyer Gregory Carre acknowledged that a preliminary navy study found that sonar could disorient 170,000 marine mammals, and leave 8,000 whales temporarily deaf.
But he defended the sonar level used by the navy as being well below the danger level for marine life.

