Awakening from a dream of Gandalf the Grey battling the Balrog, Frodo Baggins and his friend Samwise Gamgee find themselves lost in the Emyn Muil near Mordor and soon become aware that they are being stalked by Gollum, the former owner of the One Ring. After capturing him, a sympathetic Frodo decides to use Gollum as a guide to Mordor, despite Sam's objections.
Meanwhile, Aragorn, Legolas and Gimli pursue the Uruk-hai to save their companions Merry and Pippin. The Uruk-hai are ambushed by a group of Rohirrim, while the two Hobbits escape into Fangorn Forest and encounter Treebeard, an Ent. Aragorn's group later meets the Rohirrim and their leader �omer, who reveals that they have been exiled by their king Th�oden who is being manipulated by Saruman and his servant Gr�ma Wormtongue into turning a blind eye to Saruman's forces running rampant in Rohan. While searching for the Hobbits in Fangorn, Aragorn's group encounters Gandalf, who, after succumbing to his injuries while killing the Balrog in Moria, has been resurrected as Gandalf the White to help save Middle-earth.
Aragorn's group travels to Rohan's capital city Edoras, where Gandalf releases Th�oden from Saruman's influence and Wormtongue is banished. After learning of Saruman's plans to wipe out Rohan with his Uruk-hai army, Th�oden decides to evacuate his citizens to Helm's Deep, an ancient fortress that has provided refuge to Rohan's people in times past, while Gandalf departs to acquire the aid of �omer's army. Aragorn establishes a friendship with Th�oden's niece, �owyn, who quickly becomes infatuated with him. That night, Aragorn experiences a dream of him meeting with Arwen who then tells him that he must depart with Frodo and reassures him when he doesn't feel confident enough that his path is set for him. When the refugees come under attack by Warg-riding Orcs sent by Saruman, Aragorn falls off a cliff and is presumed dead. However, he is awoken by his horse Brego and rides to Helm's Deep. That same night, Arwen is told by her father Elrond that Aragorn will not be returning. He tells her that if she remains in Middle-Earth, only death and destruction await her, even if Aragorn were to survive and become King of Gondor, and if Sauron is defeated again, she will die alone. This convinces her to reluctantly depart for Valinor. The defenders at Helm's Deep are joined by a detachment of Elves from Lothl�rien. The Uruk-hai army arrives at Helm's Deep that night and a night-long battle ensues. The Uruk-hai breach the outer wall using gunpowder-like explosives and force the remaining defenders to retreat into the inner castle.
Merry and Pippin, having convinced Treebeard that they were allies, are brought to an Ent Council in Fangorn where the Ents decide not to assist in the war. Pippin then tells Treebeard to take them in the direction of Isengard, where they witness the devastation caused to the forest by Saruman's war efforts. An enraged Treebeard summons the Ents and they storm Isengard, drowning the orcs by breaking their river dam and stranding Saruman in Orthanc.
At Helm's Deep, Aragorn convinces a despairing Th�oden to ride out and meet the Uruks in one last charge. Gandalf and �omer's horsemen arrive at sunrise, turning the tide of the battle. The Uruk-hai flee into Fangorn forest, which has moved closer to the battle at the urging of Treebeard, where they are destroyed. Gandalf warns that Sauron's retaliation will be terrible and swift.