The U.S. Navy Marine Mammal Program (NMMP), based in San Diego, CA, began in 1960 when the military examined the Pacific White-sided Dolphin, trying to figure out the secret to its hydrodynamic body with the aim of improving torpedo performance. (Given 1960s technology, the NMMP never managed to solve the puzzle.) That later expanded to other marine mammals of the Pacific, especially other dolphins and California sea lions, which led to the discovery that these animals are not only trainable but fairly reliable even while untethered in the open ocean.
NMMP has been a controversial program, but the Navy insists that the program complies with all available statutes, including the Marine Mammal Protection Act and the Animal Welfare Act. The NMMP also states that, despite rumors, marine mammals have never and will never be used as weapons themselves. No attack dolphins.
So what does the NMMP do now? Dolphins are used as undersea mine detectors, even finding more than 100 in the Persian Gulf during the Iraq War in 2003. Dolphins and sea lions are used as sentries to find and alert the military to unauthorized swimmers and divers, and sea lions are used to retrieve objects from the ocean depths (at this they outperform human and robotic swimmers by a fair margin).