U.S. District Judge Florence-Marie Cooper's order came after the Defense Department granted the Navy a six-month exemption from the federal Marine Mammal Protection Act to allow use of the "mid-frequency active sonar."
Environmentalists had argued the exemption was aimed at circumventing the lawsuit they filed last week to stop the Navy's use of the sonar in the Rim of the Pacific 2006 exercise.
Government lawyers were reviewing the ruling, and the Navy will probably respond soon, said Jon Yoshishige, a spokesman for the U.S. Pacific Fleet in Hawaii.
Meanwhile, participants in the multinational exercise will search for submarines using "passive sonar," which historically has been used during such exercises, Vice Adm. Barry Costello, commander of the U.S. 3rd Fleet, said in a statement late Monday.
Active sonar locates objects by analyzing sound bounced off them, while passive sonar involves analyzing noises generated by the objects.
Costello said Tuesday that using active sonar to track submarines is a skill that would deteriorate with a lack of practice.
"The threat for the future is diesel submarines and they are proliferating in the western Pacific," Costello told The Associated Press. "I know active sonar is the only effective means today to track and target diesel submarines."
The Navy estimates Western Pacific nations own at least 140 diesel submarines. The newer models are quieter and can travel longer distances without surfacing, making them more difficult to detect.
Cooper, who based her Monday order on the National Environmental Policy Act, wrote that the Navy's failure to prepare an environmental impact statement or to take a "hard look" at the potential environmental impact of war games amounted to an "arbitrary and capricious" violation of that act.
The Natural Resources Defense Council, the environmental group leading the lawsuit, points to the stranding of more than 150 disoriented melon-headed whales in Hanalei Bay two summers ago while the U.S. Navy and its allies were using sonar in nearby exercises.
An April report by the National Oceanic and Atmospheric Administration said naval sonar may have prompted the whales, normally found in deep water, to seek refuge in the bay.
"Of course the Navy needs to train, and our lawsuit doesn't seek to prevent them from training," said Joel Reynolds, the council's senior attorney. "Our goal is simply to require them to incorporate a series of common-sense measures."
The Navy said there is no conclusive evidence to blame sonar for the incident. Even so, the service agreed to take steps such as conducting aerial surveys for marine mammals before and after ships turn on their sonar and restricting sonar use to certain areas.
The Navy says it must practice hunting submarines near the Hawaiian islands because they are in the type of environment where it most likely will face an emerging threat of submarine warfare.
Forty ships from eight countries are participating in RIMPAC, the world's largest international maritime war games.