Callow, rich Ensign Willis Seward Keith (Robert Francis), reports for his first assignment aboard the Caine, which is homeported in Pearl Harbor. “Willie”, as he is known by his fellow officers, is disappointed to find that the Caine is a small, battle-scarred destroyer-minesweeper. Its gruff captain, Lieutenant Commander William H. DeVriess (Tom Tully), has almost completely given up on discipline, and the crew has become slovenly and superficially undisciplined, although their performance is excellent. Keith has already met the executive officer, Lieutenant Stephen Maryk (Van Johnson), and is introduced to the communications officer, Lieutenant Thomas Keefer (Fred MacMurray), a novelist in civilian life. Keith has an opportunity to transfer from the ship to a more glamorous billet as an Admiral’s aide, but decides to stay aboard. However, Keith remains frustrated with the ship’s lack of discipline, despite his own shortcomings.
The captain is soon replaced by Lieutenant Commander Phillip Queeg (Humphrey Bogart), a no-nonsense career veteran who immediately attempts to instill discipline into the crew. At first, Keith is relieved to have a strict commander, but he soon gets concerned about Queeg’s erratic behavior, which includes fumbling with a pair of steel balls.
The next day, the Caine is assigned to tow a target for gunnery practice. Queeg is distracted berating Keith and Keefer over a crewman’s appearance after giving an order to turn, and he cuts off the helmsman’s attempt to warn him that they are turning back on their own towline. After the Caine continues in a circle and cuts the towline, Queeg tries to cover up his responsibility for the incident.
Other incidents serve to undermine Queeg’s authority. Under enemy fire, Queeg abandons escorting a group of landing craft during an amphibious assault long before they reach the fiercely defended shore, instead dropping a yellow dye marker in the water and leaving the landing craft to fend for themselves, much to the crew’s disgust. Afterward, Queeg speaks to his officers, not explicitly apologizing, but bending enough to ask for their support. His disgusted subordinates do not respond.
When strawberries go missing from the officers’ mess, the captain, once again clicking the steel balls, goes to absurd lengths to hunt down the culprit. Despite being told by one of his officers that the mess staff had eaten the fruit, Queeg insists otherwise and proudly tells Maryk and Keefer that as an ensign he was commended for unmasking a cheese thief.
Keefer begins trying to convince Maryk that he should relieve Queeg on the basis of mental illness under Article 184 of Navy Regulations. At first Maryk displays loyalty to Queeg, even threatening Keefer with a charge of insubordination. Maryk begins keeping a journal, documenting Queeg’s behavior. Keefer convinces Maryk and Keith to join him in presenting the case to Admiral William F. Halsey, Jr.. While aboard Halsey’s flagship, Keefer realizes that Queeg’s documented actions could be interpreted as reasonable attempts to instill discipline, leaving the officers open to a charge of conspiring to mutiny. When Halsey’s aide tells the Caine officers that Halsey will see them, Keefer talks Maryk and Keith out of making the complaint.
Matters come to a head during a violent typhoon. Maryk urgently recommends that they steer into the waves and take on ballast, but Queeg refuses to deviate from the fleet-ordered heading and declines Maryk’s request for ballast. He fears that it would foul the fuel lines with salt water. When Queeg appears to become paralyzed in action, Maryk relieves him, with Keith’s support.
Upon returning to port, Maryk and Keith face a court-martial for mutiny. After questioning them and Keefer, Lieutenant Barney Greenwald (José Ferrer) reluctantly accepts the job of Maryk’s defense counsel, which a number of other lawyers have already turned down.
The proceedings do not go well, as Keefer has carefully covered himself and denies any complicity. Navy psychiatrist Dr. Dixon (Whit Bissell) testifies that Queeg is not mentally ill, but when Queeg is called to testify, he exhibits paranoid behavior and begins to click the ball bearings together in his hand under Greenwald’s tough cross-examination. Maryk is acquitted, and Keith is spared any charges.
The Caine officers celebrate the trial’s results at a hotel. Keefer shows up, telling Maryk privately he did not have the guts not to. Greenwald appears and clears his “guilty conscience”. Apparently drunk, he berates the officers for not appreciating the years of danger and hardship endured by Queeg, a career Navy man. He lambastes Maryk, Keith, and finally Keefer, for not supporting their captain when he most needed it. Under his attack, Maryk and Keith admit that if they had given Queeg the support he had asked for, he might not have “frozen” during the typhoon.
Greenwald turns to Keefer, denouncing him as the real “author” of the mutiny, who “hated the Navy” and manipulated the others while keeping his own hands officially clean. The lawyer exposes Keefer’s double-dealing to the other officers, throws a glassful of champagne in his face and tells Keefer that if he wishes to do anything about the drink in the face, the two could fight outside. Keefer does not respond to the challenge and the other officers depart, leaving him alone in the room.
A few days later, Keith has received his promotion to Lieutenant, junior grade and reports to his new ship. He is surprised to find he is serving again under DeVriess, who has been promoted to Commander. DeVriess lets Keith know that he will start with a clean slate.