Walter F. Mazzone, a retired Navy captain who pushed the limits of human underwater activity in battle and in peace, first aboard submarines during World War II and later with the Navy’s pioneering Sealab program, died Aug. 7 at his home in San Diego. He was 96.

He had heart ailments, said his son, Robert Mazzone.

Capt. Mazzone joined the Navy in 1942, after the Japanese attack on Pearl Harbor that prompted the United States’ entry into World War II. He distinguished himself during two submarine missions in the Pacific that easily could have cost him his life.

He was among the crew members aboard the USS Puffer in 1943 when the submarine endured what the Journal of Military History described as “one of the worst depth-charge attacks of World War II.” The Puffer was submerged in the waters near Borneo for nearly 38 hours, perhaps the longest dive in the war, and suffered a relentless assault by the Japanese while the crew suffered from oxygen deprivation.

The next year, Capt. Mazzone was aboard the USS Crevalle when the submarine was dispatched to the island of Negros in the Philippines to retrieve Japanese battle plans that had been intercepted by Philippine guerrillas. The Crevalle also was scheduled to pick up two dozen missionaries and other civilians, Capt. Mazzone’s son said.

Walter Mazzone, left, and George Bond on their way to visit Sealab II in 1965. (Photo by U.S. Navy)

When the submarine surfaced to rendezvous with the guerrillas, the crew learned that there were 40 civilians — 15 more than expected. Among them were a number of children and a pregnant woman. Capt. Mazzone was said to have brought aboard a goat so that the children and expectant mother would have more nutritious milk than the powdered stuff stocked in the submarine.

As the Crevalle made its way back to Australia, it became engaged in a battle with the Japanese but made it to safety with the civilians in tow. The episode was recounted in “The Silent Service,” a 1950s television program about the Navy submarine fleet, and in the book “The Rescue” by Steven Trent Smith.

After the war, Capt. Mazzone pursued graduate studies before joining the Navy’s Medical Research Laboratory in New London, Conn. There, he became a top assistant to George Bond, a Navy doctor who had embarked on a research project with the goal of keeping divers under the water at greater depths and for longer periods than ever before.

Capt. Mazzone helped Bond lead the animal and human tests that developed saturation diving, a technique that made possible dives lasting hours, days and eventually weeks. It also made possible the Navy’s Sealab initiative, an exploration that mirrored NASA’s race to the moon and also was known as the “Man in the Sea” program.

Capt. Mazzone was “extremely bright and resourceful,” said Ben Hellwarth, the author of the book “Sealab: America’s Forgotten Quest to Live and Work on the Ocean Floor,” and became an indispensable right-hand man to Dr. Bond and for the Sealab program.”

Sealab I, the first U.S. underwater station of significant depth and duration, was launched in 1964 off the coast of Bermuda. Sealab II, lowered into the waters off California, followed in 1965. Sealab III, also located near California, was lowered in 1969. The program was discontinued that year when an aquanaut died while attempting to repair a leak.

Although the Sealab had ended, its discoveries continued to be used for scientific, commercial and military-intelligence purposes. In 1971, a submarine, the USS Halibut, plunged into the depths of the Sea of Okhotsk near Russia. Relying on techniques developed at Sealab, the Associated Press reported, divers obtained Soviet test missiles and tapped a cable that gave U.S. intelligence access to Soviet naval communications.

Walter Francis Mazzone was born Jan. 19, 1918, in San Jose, Calif. He received a science degree in 1941 from what is now San Jose State University, a doctor of pharmacy degree from the University of Southern California in 1948 and a master of public health degree from Harvard University in 1964.

Capt. Mazzone remained in the Navy Reserve after World War II and returned to active duty in 1950, after the outbreak of the Korean War. He was stationed in Japan before returning to stateside duty, where he met Bond.

His decorations included the Silver Star, the Bronze Star and the Navy Commendation Medal, as well as several awards of the Legion of Merit, his son said.

After retiring from the Navy Medical Service Corps in 1970, Capt. Mazzone did civilian work for the Navy and was a program manager at the government contractor SAIC.

His wife of 66 years, Lucie Oldham Mazzone, died in 2012. Survivors include their son, retired Navy Capt. Robert Mazzone of Escondido, Calif.; two grandchildren; and five great-grandchildren.

One of the most noted participants in Sealab was Scott Carpenter, the former astronaut who, having explored the skies, turned to explore the seas.

“Most nights I had long conversations with the surface, particularly with Captain Walter Mazzone, who acted as the project’s executive officer,” Carpenter wrote in an account published in Life magazine in 1965. Capt. Mazzone, he continued, was “a wise, calm and humorous man, and it was good to talk things over with him after a hard day’s work.”