The crew of the submarine North Dakota raced through bad weather to save a shipmate’s life after an unidentified petty officer shot himself in the chest with his military-issued rifle while the vessel was underway, according to Navy officials and a post on the boat’s Facebook page.

Cmdr. Mark Robinson, the boat’s captain, praised his crew in the post for their feverish efforts on Friday to get the sailor back to land.

Corpsmen leapt into action to treat and stabilize the man’s injuries, while radiomen kept communications open in bad weather, allowing trauma doctors to remotely lend assistance, according to the post.

The boat’s navigation and driving teams charted the fastest way back to port and cut through heavy seas on their way to the mouth of the Thames River in New London, Connecticut, where they transferred the sailor to a waiting tug.

“From gunshot to ambulance took about 7 hours,” Robinson said in the post. “We drove up the river in dense fog, in the dark of night, with intense rain and wind. It was the worst weather I’ve ever seen for something like this.”

Other crew members helped in other ways.

Some lashed themselves to the boat’s deck in “Pea Soup” fog around midnight to form a human safety net, blocking the weather for paramedics conducting the transfer, he said.

“Sailors dissembled parts of the ship to set up ways to get the sailor off in a stretcher more comfortably,” Robinson said. “When the sailor was lucid, other crew members held a phone in front of his face to let him watch music videos.”

Some stood exposed in the storm to flash lights and help lead the tugs.

“I can’t truly express the amount of heroism I saw in the last 48 hours,” Robinson said in Tuesday’s post. “As a result, the Sailor is recovering from surgery in a hospital in New Haven with his parents by his side.”

“It was a terrible event,” he said, “but the sailors of (North Dakota) are heroes.”