Former U.S. Army Captain Nathan Algren, a bitter alcoholic traumatized by the atrocities he committed during the American Indian Wars, is approached by his former commanding officer Colonel Bagley to train the newly created Imperial Japanese Army for a forward-thinking Japanese businessman Omura, who intends to use the army to suppress a Samurai-headed rebellion against Japan’s new emperor. Despite his hatred of Bagley for his role in the Indian Wars, an impoverished Algren takes the job for the money, and is accompanied to Japan by his old friend, Sergeant Zebulon Gant. Upon arriving, Algren meets Simon Graham, a British translator knowledgeable about the samurai.
Algren finds the Imperial soldiers are actually conscripted peasants that have no knowledge of firearms or battle. Early in their training, Algren is informed that the samurai are attacking one of Omura’s railroads; Omura sends the army there, despite Algren’s protests that they are not ready. The battle is a disaster; the undisciplined conscripts are routed and Gant is killed. Algren fights to the last before he is surrounded; expecting to die, he is taken prisoner when samurai leader Katsumoto decides to spare him. Algren is taken to Katsumoto’s village to live among his family. While he is poorly treated at first, he eventually gains the samurai’s respect and actually becomes friends with Katsumoto. Algren overcomes his alcoholism and guilt, and learns the Japanese language and culture. He develops sympathy for the samurai, who are upset that the pace of modern technology has eroded the traditions of their society. Algren and Taka, Katsumoto’s sister and the widow of a samurai killed by Algren, develop an unspoken affection for each other.
One night, a group of ninjas infiltrate the village and attempt to assassinate Katsumoto. Algren saves Katsumoto’s life, and then helps defend the village. Katsumoto requests a meeting with Emperor Meiji and is given safe passage to Tokyo. He brings Algren, intending to release him. Upon arriving in Tokyo, Algren finds the Imperial Army is now a well-trained and fully equipped fighting force. Katsumoto, to his dismay, discovers that the young and inexperienced Emperor has essentially become a puppet of Omura. At a government meeting, Omura orders Katsumoto’s arrest for carrying a sword in public and asks him to commit Seppuku to redeem his honor. Algren refuses Omura’s offer to lead the new army to crush the rebels, due to his sympathy. Omura sends assassins to kill Algren, but Algren kills them. Algren assists the samurai in freeing Katsumoto; in the process, Katsumoto’s son Nobutada is mortally wounded, sacrificing himself to allow the others to escape.
As the Imperial Army marches to crush the rebellion, a grieving Katsumoto contemplates Seppuku, but Algren convinces him to fight until the end, and joins the samurai in battle. The samurai use the Imperial Army’s overconfidence to lure them into a trap and deprive them of artillery support. The ensuing battle inflicts massive casualties on both sides and forces the Imperial soldiers to retreat. Knowing that Imperial reinforcements are coming and defeat is inevitable, Katsumoto orders a suicidal cavalry charge on horseback. During the charge, the samurai break through Bagley’s line. Bagley is killed by Algren, but the samurai are quickly mowed down by gatling guns. The Imperial captain, previously trained by Algren and horrified by the sight of the dying samurai, orders all of the guns to cease fire, disregarding Omura’s orders. A mortally wounded Katsumoto commits Seppuku with Algren’s help as the soldiers at the scene kneel in respect.
Days later, as trade negotiations conclude, Algren, though injured, arrives and interrupts the proceedings. He presents the Emperor with Katsumoto’s sword and asks him to remember the traditions for which Katsumoto and his fellow Samurai died. The Emperor realizes that while Japan should modernize, it cannot forget its own culture and history; he promptly rejects the trade offer. When Omura attempts to protest, the Emperor silences him by threatening to seize the Omura family assets and distribute them among the populace.
While various rumours regarding Algren’s fate circulate, Graham concludes that Algren had returned to the village to reunite with Taka.