A federal judge has ruled in favor of environmentalists who assert that the Navy has vastly underestimated the threat to marine mammals posed by its use of sonar and explosives during training off Southern California and Hawaii.

U.S. District Judge Susan Oki Mollway in Hawaii ruled Tuesday that the National Marine Fisheries Service violated environmental laws when it decided that the Navy's training would have a "negligible impact" on whales, dolphins, other mammals, and sea turtles.

The ruling appears to set the stage for an appeal or for the Navy to resubmit its application to the fisheries service for a permit. Other options would be for the Navy to relocate its training or adopt stronger safeguards for sea creatures.

The ruling was hailed by environmental groups, which have long asserted that the Navy is needlessly harming whales and other animals and has resisted making changes to train in less "biologically sensitive areas."

Navy spokesman Mark Matsunaga said the service was studying the ruling and could not comment on its details.

The lawsuit was aimed at curtailing Navy training from Dana Point to San Diego, off Coronado's Silver Strand, and in the areas between various Hawaiian islands.

The Navy holds a major multinational exercise off Hawaii every two years. The next is set for 2016. The Hawaii exercise, called Rim of the Pacific, and exercises off Southern California allow sailors to train in using sonar to detect submarines in shallow water, not unlike the conditions in the Persian Gulf, the Navy has said.

Much of the judge's ruling deals with the dueling interpretations about how many animals over a five-year period of training would be hurt.

The Navy asserts that training will kill 155 whales over five years. The environmentalists say the number of those killed or crippled would be much higher.