Submarine
USS S-48 sank by the stern in Long Island Sound during a pre-commissioning test dive on December 7. 1921. A manhole on a ballast tank had not been secured by a workman in the builder's yard in Bridgeport,CT (Lake Torpedo Boat Company). Fortunately, the sinking was in relatively shallow water. Despite chorine gas from the batteries and a host of other problems, the crew was able to shift weight aft and blow ballast tanks, tilting the sub at an extreme angle. That brought the bow out of the water and some of the sailors were able to leave the boat through the torpedo tube.
By then it was night and the crew had to resort to burning oil-soaked mattresses to try to signal a passing boat. It took hours to finally attract the attention of a passing boat, the Standard Oil tug
Socony 28. Eventually realizing the scope of the disaster and that going too close could force the bow of the sub under water, the tug's master stood off from the sub and launched its lifeboat. Every man on the tug volunteered to row the lifeboat through stormy seas. In an hour, the tug's crew had made four trips and rescued all 41 men on the sub.
S-48 was raised and repaired. She was commissioned ten months later. The fortunate part of this story was that the sub's captain (a shipyard employee, as the boat hadn't yet been commissioned) opted to conduct the first test dive just after clearing the sea buoy, before proceeding to deeper water off New London for a deeper dive. If the shallow dive had been conducted in the area planned for the second dive, the sub would have been lost with all hands.
As naval budgets waxed and waned,
S-48 was repeatedly decommissioned and reactivated. She provided training services (probably by acting as a training target) during the Second World War. She was decommissioned a few days before Japan formally surrendered and was scrapped the following year.
You can read a detailed story about the sinking and the rescue
here.