In a settlement announced this week, the United States Navy agreed to limit activities around sensitive whale and dolphin habitats off the coast of Southern California and Hawaii.

The agreement ends two lawsuits brought against the Navy by conservation groups concerned that certain naval activities were harming marine mammals. In addition to whales and dolphins getting hit by ships or injured or killed while testing explosives, one of the major concerns of the conservation groups was the use of sonar used for navigation. Sonar uses sound waves which bounce off objects and create a map to help locate hidden objects in the water. Because sound travels extremely well underwater, these sonar pings from Navy ships can damage the hearing of whales and dolphins.

Dolphins and whales use sound to find their way through the ocean (known as echolocation) and also to communicate with each other. Their hearing is extraordinarily sensitive, and conservation groups have pushed for both governments and private companies to sharply curtail the use of loud noises like sonar and explosions in the water.

“If a whale or dolphin can’t hear, it can’t survive,” David Henkin, an attorney for Earthjustice who brought one of the lawsuits, said in a statement. “We challenged the Navy’s plan because it would have unnecessarily harmed whales, dolphins, and endangered marine mammals, with the Navy itself estimating that more than 2,000 animals would be killed or permanently injured. By agreeing to this settlement, the Navy acknowledges that it doesn’t need to train in every square inch of the ocean and that it can take reasonable steps to reduce the deadly toll of its activities.”

Though indiscriminate use of machine-made sonar can be harmful, there has been some success in harnessing the sonar of whales and dolphins to keep them away from fishing nets by attaching small devices to the nets that reflect back noise produced by whales, alerting them to the potentially deadly obstruction. The Navy itself actually has a fairly long history with marine mammals. Until recently dolphins were used regularly to search for undersea mines, however the program is being phased out over the next few years.