The British submarine, HMS Trojan is out on a routine exercise to test its new snorkel mast. She encounters an unrecovered Second World War magnetic mine. When she dives the mine is set off, and blows off the bows of the submarine. The after section floods from the displaced snorkel mast, killing the 53 crew-members in the bow and stern sections. She settles to the bottom leaving twelve crew members alive amidships, saved by the watertight doors which have been closed by order of the captain when he realises the imminent danger.
When the shore base becomes aware that Trojan is overdue, surface rescue vessels are sent out to investigate. The captain of the submarine, Lieutenant Commander Peter Armstrong (John Mills), sensibly provides an indication of their position to these vessels by expelling a quantity of oil which rises to the surface. Following standard escape procedure, a diver is sent down with an air line while everyone prepares for the rescue. Armstrong selects the first four for release; they escape safely without incident, and are picked up on the surface. The eight remaining crew assume there are plenty of breathing sets for them all to escape successfully. However, the captain discovers that all but four have been destroyed in the blast. This means the final four will have to remain under water until a full salvage operation can be carried out, which may take a week or more.
Armstrong assembles the others to draw lots through a pack of cards he deals out, to decide who goes and who remains. Two, the cook A/B Higgins (James Hayter) and the first lieutenant, Lieutenant Manson (Nigel Patrick), with the lowest cards, select themselves to stay behind along with Armstrong. The top three, to go first, also select themselves with high cards. Of the other two, there is a tie, both knaves, between Stoker Snipe (Richard Attenborough) and E.R.A. Marks (George Cole). On losing a re-deal, young Snipe goes berserk with fear and has to be physically restrained. Armstrong approaches Marks and asks if he will forfeit his place for Snipe, sensing difficulties if Snipe is left behind. Marks agrees.
They begin to prepare for escape, but Snipe now hangs back, falsely claiming he has hurt his arm in the scuffle. He insists that Marks should go. Marks and the other three escape safely through the hatch and are picked up by the salvage vessels. Below, Manson has a fainting fit, which he says is a result of having previously suffered from malaria, but Snipe catches him using both arms without difficulty. Cheerfully at first, the four begin the wait for the salvage operation.
Above, all goes well to begin with, in fine weather. Divers manage to secure cables under the submarine, which is slowly winched up, but only fifteen feet per day can be achieved. However, as the days go by, the weather turns, and soon there is a full storm at sea. As a result, the submarine shifts on the cables, and sinks again to the floor of the sea. Manson has remained in ill-health below, nursed with care by Snipe. However, chlorine begins to leak from a site next to his bunk. Manson is overcome by the gas, and dies.
The storm is so bad that the captain of the salvage ship decides his own men are at risk, and abandons the salvage operation altogether. The three left in the submarine sense that there is no hope for them. The film ends with Armstrong reading from a naval prayer book.
From early scenes in the film, and from dialogue throughout, the viewer is given insights into the personal and home lives of the crew, their hopes, and their now thwarted ambitions. For example, Snipe is married to a wayward wife, whom he idolises; whilst Armstrong has been offered a lucrative shore job by his wealthy father-in-law, and had been planning to leave the Navy to take it up as soon as this patrol was over.