San Francisco - A federal appeals court on Tuesday ordered the U.S. Navy to lessen the harm its high-power sonar does to whales and other marine life during exercises off the Southern California coast.

The 9th Circuit U.S. Court of Appeals sent the matter to a trial judge in Los Angeles to figure out exactly how to fix the problem it says is apparent with the sonar. The three-judge panel said the sonars need to be fixed before the Navy's next planned exercise in January.

The action was taken because the court said it's likely the Natural Resources Defense Council will win its lawsuit to force the Navy to lessen the harm.

The appeals court previously overturned a blanket ban on the naval exercises, ruling that prohibition was too broad.

The council's lawsuit alleges the Navy's sonar causes whales to beach themselves among other environmental harms.

"There are simple, proven ways to avoid this problem without compromising the Navy's readiness," said Joel Reynolds, senior attorney and director of the Marine Mammal Protection Project at the NRDC.

The Navy maintains it already minimizes risks to marine life. It has monitored the ocean off Southern California for the 40 years it has employed sonar without seeing any whale injuries. It said the sonar is vital for tracking submarines.