In 1860, during the final years of the Edo period and the demise of the Tokugawa shogunate,[a] a rōnin wanders through a desolate Japanese countryside. While stopping at a farmhouse, he overhears an elderly couple lamenting that their only son has given up farm labouring in order to run off and join the rogues who have descended on a nearby town that has become divided by a gang war. The stranger heads to the town where he meets Gonji, the owner of a small izakaya who advises him to leave. He tells the rōnin that the two warring clans are led by Ushitora and Seibei; Ushitora was the right-hand man of Seibei but rebelled when Seibei decided to hand over the reins to his son Yoichiro, a useless youth. The town’s mayor and its silk merchant, Tazaemon, had long been in Seibei’s pocket, and Ushitora aligned himself with the sake brewer, Tokuemon, proclaiming him the new mayor. After sizing up the situation, the stranger says he intends to stay, as the town would be better off with both sides dead.
He first convinces the weaker Seibei to hire him as a swordsman by effortlessly killing three of Ushitora’s men. When asked his name, he sees a mulberry field and states his name is Kuwabatake Sanjuro, where 桑畑 Kuwabatake = “mulberry field” and where 三十郎 Sanjuro (“thirty-years-old”).
Seibei decides that with the ronin’s swordsmanship, the time is right to fight Ushitora. However, Sanjuro eavesdrops on Seibei’s wife, who orders her son to kill him after the upcoming raid so that they will not have to pay his large fee. Sanjuro leads the attack on the other faction, but then “resigns”, leaving Seibei to his fate. Before the two sides clash, the unexpected arrival of a bugyō (an Edo-period government official) forces both sides to make a bloodless retreat.
Eventually the bugyō is called away because a government official has been murdered in another town. Sanjuro soon learns two assassins hired by Ushitora committed the murder to get the official to leave. With this knowledge, Sanjuro captures the pair of killers and sells them to Seibei, but then tells Ushitora that it was Seibei’s men who caught them. An alarmed Ushitora rewards him for his help. Ushitora then orders the kidnapping of Seibei’s son, whom he offers in exchange for the two prisoners. However, Ushitora double crosses Seibei at the swap when his brother, Unosuke, shoots the assassins with a pistol; anticipating a betrayal, Seibei kidnaps Ushitora’s mistress. The next morning, she is exchanged for Seibei’s son.
Sanjuro learns that the woman, Nui, is the wife of a local farmer who lost her to Ushitora over a gambling debt, who then gave her away as chattel to Tokuemon in order to gain his support. Sanjuro tricks Ushitora into revealing the place where Nui is hidden, then kills the guards and reunites the woman with her husband and son and tells them to leave town immediately. Pretending to be on Ushitora’s side, Sanjuro is able to convince Ushitora that the woman was kidnapped by Seibei’s men. The gang war escalates. Ushitora burns down Tazaemon’s silk warehouse, and Seibei retaliates by trashing Tokuemon’s brewery. After some time, Unosuke becomes suspicious of Sanjuro and the circumstances surrounding Nui’s escape. Eventually Sanjuro is severely beaten and imprisoned by Ushitora’s thugs after Unosuke discovers evidence of his double cross.
Sanjuro manages to escape when Ushitora decides to eliminate Seibei once and for all. As he is being smuggled out of town in a coffin by Gonji, he witnesses the brutal end of Seibei, his family and his clan. Sanjuro recuperates in a small temple near a cemetery. However, when he learns that Gonji has been taken by Ushitora, he returns to town. Sanjuro kills Ushitora, his men, and Unosuke. He spares only one terrified young man he encountered on his way into town. As Sanjuro surveys the damage, Tazaemon comes out of his home, in a samurai outfit and beating a prayer drum. Tazaemon circles around town and then goes after and kills Tokuemon. Sanjuro frees Gonji and then departs.