Nine young samurai, including his nephew, believe that the lord chamberlain, Mutsuta, is corrupt after he tore up their petition against organised crime and said maybe he himself was behind the crimes. One of them tells the superintendent of this and he agrees to intervene. As the nine meet secretly at a shrine and discuss their problem, a ronin (Mifune) emerges from another room where he has been resting. The ronin has overheard their plans, and suggests that the superintendent is in fact the real corrupt official. While at first the samurai are insulted by his claims, they soon find themselves surrounded by the superintendent's men, proving that he was correct. The ronin hits a few of the attackers and bluffs their leader into leaving, taking only a small amount of money in reward to buy food because he is starving; however, after realizing that Mutsuta and his family must now be in danger, he decides to help the samurai bring down the corrupt officials.
When the samurai go to Mutsuta's house, they find that he has been abducted and his wife (played by Takako Irie) and daughter (Reiko Dan) are imprisoned in the house. Following the ronin's suggestion, a servant from the house gets the guards drunk, allowing the samurai to free the women. The group hide in a house next door to the superintendent's compound, which contains a large number of (camellia) trees. Mutsuta's wife asks the ronin's name; looking out of the window at the tsubaki (camellia) trees, which he can see over the fence separating the two properties, he invents the name Tsubaki Sanjūrō, meaning "camellia thirty-year-old man" (similar to the name he assumed in the previous film). The lady chastises Sanjuro for using his sword too frequently and insists that he refrain from unnecessary killing, noting that the best swordsmen keep their weapons in their sheaths.
The Superintendent's henchman, Muroto Hanbei (Tatsuya Nakadai), and several other corrupt officials address a plan to outsmart the chamberlain's followers. First they post an open notice that the chamberlain has been arrested and charged with being involved in organized crime. Afterwards, they try to lure out the samurai by sending out the officials' empty palanquins, assuming that the samurai will think the corrupt officials are in them and attack. This backfires on them, however, when a posse of people from the town, inflamed by the open notice, ride out to protect the palanquins, just as the samurai are preparing to attack. The samurai then retreat to their hideout.
Sanjuro decides to get closer to Hanbei's master by going undercover as his henchman. Mistrust causes several of the samurai to believe he is switching sides. The samurai agree that four of them will follow him: two who believe in him and two who do not. However, Sanjuro realizes he is being followed and the four are easily captured by Hanbei. When Hanbei leaves to request reinforcements, Sanjuro frees the four captured samurai, at the expense of having to kill all their guards. He demands that the four tie him up, and is found in that situation by Hanbei. Sanjuro tells Hanbei that they were attacked by a large number of samurai, so Hanbei declares Sanjuro cannot be hired after being defeated. To make amends, Sanjuro insincerely promises to find the attackers.
The next day, Mutsuta's wife and daughter find a piece of a petition in the small stream that flows from the superintendent's compound to their hideout. The samurai realise that this could only have come from Mutsuta, who must therefore be imprisoned in the compound. While at first they consider a full-on attack on the officials, they soon realize that the compound is full of the superintendent's forces, so that such an attack would be futile.
Sanjuro hatches a plan to get the army out of the compound, by telling Hanbei that he saw the rebellious samurai at a temple where he was sleeping. He says he will then send a signal for the samurai to attack by floating large numbers of camellias down the stream. The first part of the plan works, with the superintendent's forces rushing off to the temple; however, Hanbei catches Sanjuro trying to drop the camellias into the stream, realizes something is fishy, and ties him up. Just as Hanbei is preparing to kill Sanjuro, the remaining corrupt officials realize that Sanjuro has tricked them - his description of the temple was incorrect. They convince Hanbei not to waste any further time over Sanjuro and instead catch up with the superintendent's forces and have them return to the compound as soon as possible. In a comedic scene, Sanjuro tricks the officials into making the signal for the samurai to attack. It works and they manage to rescue Sanjuro and Mutsuta. Hanbei returns later to find he has been made a fool once again.
Mutsuta is restored to his position as chamberlain, and the superintendent commits suicide, much to the chamberlain's chagrin as he wished to avoid such a public affair, instead wishing only to force the corrupt officials to retire. As Mutsuta, his family and the loyal samurai are celebrating they discover that Sanjuro has slipped away. The nine samurai race off and find him with Hanbei, about to duel.
Sanjuro is reluctant to fight and tries to dissuade Hanbei, saying that if they fight, one of them will surely die and nothing will be gained by that. However, Hanbei is obdurate, saying his dignity has been soiled and that killing Sanjuro is the only way to restore it.
The two face off at each other and remain unmoving for almost half a minute. Finally, as Hanbei draws his sword, Sanjuro kills him by drawing and cutting in a single, faster action. A fountain of blood gushes from Hanbei and he falls dead. When the young samurai cheer his victory, Sanjuro becomes angry, says he's in a bad mood and that his dead adversary was exactly like him. He now has a fuller understanding of Lady Mutsuta's earlier admonition that the best swords are the ones that are kept in their scabbards. Sanjuro then stalks off in a huff after warning the worshipful young men not to follow him.
The story is largely based on Shūgorō Yamamoto's short story "Peaceful Days" (日日平安 Nichinichi hei-an). Originally Sanjuro was to be a straight adaptation of the story. After the success of Yojimbo the studio decided to resurrect its popular antihero, and Kurosawa reimagined the script accordingly.
The scene where a single blossom falls into a rushing stream was difficult to pull off. Originally the crew considered using piano wire but were afraid the light glinting on it would show up on film. A female costume designer suggested unraveling a woman's stocking and using the nylon due to its strength and invisibility. When it worked, Kurosawa said the happiness he felt at that moment was "indescribable".
In the same documentary Nakadai and production designer Yoshiro Muraki relate that the notorious "blood explosion" at the film's end was done in one take. At the moment that the compressor hose attached to actor Tatsuya Nakadai was activated it blew a coupling causing a much larger gush of fluid than planned. In fact it was so strong that it nearly lifted him off the ground and it took all his might to finish the scene.