In the opening scene, a flashback, two hobbits, Sméagol (Andy Serkis) and his friend Déagol (Thomas Robins), are fishing the River Anduin near the Gladden Fields in the North of Middle Earth. Déagol is dragged into the river by a powerful catch and discovers the One Ring glinting in the river bed. He collects it and climbs out of the water. Sméagol sees him fondling it and as they both succumb to the Ring's power they begin to quarrel. Sméagol demands the Ring, saying that it's his birthday and it should be his present. The squabble turns into a fight; Sméagol strangles his friend with his bare hands and pries the Ring from Déagol's clenched fist. Sméagol is ostracized from his community and driven away. Suffering terribly from loneliness and shame, Sméagol takes solace in his love for the Ring, which slowly tortures his mind. He takes solitary refuge in caves beneath the mountains, where under the influence of the Ring he lives to a very great age. He dwindles into a hunched, furtive, slinking creature known by the unpleasant noise he makes in his throat -- "Gollum."
In the present, on the outskirts of Mordor, Frodo (Elijah Wood) and Sam (Sean Astin) are resting in an alcove. Sam awakes and sees that his master has not slept. The days are growing darker the closer they get to Minas Morgul and Mordor. Gollum arrives and urges them to move on.
Away in the west, Aragorn (Viggo Mortensen), Legolas (Orlando Bloom), Gimli (John Rhys-Davies), Gandalf (Ian McKellen), Théoden (Bernard Hill), and Éomer (Karl Urban) ride through the forest of Fangorn to Isengard, where they meet Merry (Dominic Monaghan) and Pippin (Billy Boyd) feasting among the wreckage. They find Treebeard at the tower of Orthanc in the center of Isengard, where Saruman (Christopher Lee) has been trapped. Gandalf opposes Gimli's call to kill Saruman, saying that the wizard has no power anymore and will pose no further threat. Saruman shows himself to them. Gandalf shatters Saruman's staff, robbing him of his power. Grima (Brad Dourif), who is still with him, stabs him with a knife. Legolas shoots Grima with an arrow, but Saruman falls to his death, landing on the spikes of a large waterwheel. As they are talking, Pippin sees Saruman's palantír amongst the flotsam and is entranced by it, but Gandalf quickly takes it from him and hides in under his cloak.
The group rides to Edoras, where King Théoden has prepared a large banquet to 'hail the victorious dead' of the Battle of the Hornburg. There Éowyn (Miranda Otto) shows affection for Aragorn which Théoden notices; he tells her that he is happy for her, Aragorn being an honorable man and the architect of the victory at Helm's Deep. Gandalf expresses to Aragorn his concerns over the quest. Aragorn tells him to trust in what his heart tells him, that Frodo is still alive.
Gollum awakes in the night as Frodo and Sam are sleeping and goes off to one side to murmur to himself. His evil half senses some doubt in Sméagol and insists that if he can murder once (like he murdered Déagol for the ring) he can do it again. Gollum then begins leading Sméagol through their plan, to deliver the hobbits into the clutches of Shelob in Cirith Ungol, after which the Ring can be reclaimed. Sam hears the conversation and beats Gollum for his treachery. Frodo intervenes, saying that as their guide Gollum is necessary for their quest. Sam glowers as Gollum flashes him an evil smile while Frodo's back is turned.
That same night back in Edoras, Pippin's curiosity gets the better of him; relieving a sleeping Gandalf of the palantír, he looks into it. Pippin sees a vision of a white tree in a stone courtyard set ablaze, but in doing so he is caught by Sauron and submitted to mental torture and questioning. Aragorn tries to rescue him, briefly exposing himself to Sauron. Pippin recovers from his ordeal and it is discovered that he did not tell Sauron anything of the Ring's whereabouts. From Pippin's vision of the White Tree, Gandalf deduces that Sauron is now moving to attack the great Gondorian city of Minas Tirith and he rides off to send warning, taking Pippin with him, lest his urge to look into the palantír (left now in Aragorn's keeping) return again.
Leaving Rivendell on her way to the Undying Lands, Arwen (Liv Tyler) has a vision of Eldarion (Sadwyn Brophy), the son she will have with Aragorn. She realises that her father lied to her when he said she and Aragorn had no future together. She returns to Rivendell and convinces Elrond (Hugo Weaving) that having forsaken the life of the Eldar, she cannot leave Aragorn now. She tells her father that as foretold, the time to reforge Narsil has come. Narsil, the sword of Elendil, is the birthright of the true heir of Isildur, the man who used the sword to cut the One Ring from Sauron's hand.
Gandalf and Pippin arrive at Minas Tirith, City of Kings, that was built out of the rock of Mindolluin. There Pippin recognises the White Tree as they go to find the Steward Denethor (John Noble). They approach him as he mourns over Boromir (Sean Bean), his son. Pippin swears loyalty to him in recompense for Boromir's sacrifice. Denethor seems to be caught up in his grief and has not taken measures to fortify the city against the threat of Sauron.
Meanwhile, Frodo, Sam, and Gollum arrive at Minas Morgul. Wary of the enemy, they locate the Winding Stair (leading to the pass of Cirith Ungol) that lies hidden in the cliffs surrounding the accursed city. Just at that moment, the doors of the city open and the Witch-king of Angmar, leader of the Nazgûl, dispatches his immense Orc army from his lair, heralding the start of the war. The outpouring of the army is witnessed by Gandalf and Pippin as a flash of lightning shoots up at the opening of the doors. At the urging of Gandalf, Pippin lights the first of the beacon signals to Edoras, alerting Théoden, Aragorn and the rest of the Rohirrim to muster at Dunharrow and thence to Minas Tirith. As they leave Edoras, Aragorn notices that Éowyn saddles up with them and that she is girt with a sword, but she insists that she rides only to see them off and that the men have found their captain in Aragorn.
The Morgul army crosses Anduin at Osgiliath in makeshift boats and engages the Gondorian contingent (lead by Boromir's brother Faramir (David Wenham)) in battle. The orcs prove too strong and drive the Gondorians out of Osgiliath; Faramir and his few surviving men retreat to Minas Tirith, pursued by the Nazgûl. Gandalf, riding out to meet the retreating men, wards them off, saving Faramir. Upon his arrival, Faramir (who met Frodo, Sam, and Gollum in Ithilien just before they headed for the mountain pass into Mordor) tells Gandalf of the dangerous route Gollum is taking Frodo and Sam on, convincing Gandalf of Gollum's treachery. The hobbits, lead by Gollum, are struggling to climb the extremely steep stairs. Gollum reaches out and empathises with Frodo, saying that he understands his pain. Gollum also poisons Frodo against Sam, saying that Sam will try and take the Ring from Frodo.
In the captured Osgiliath, the Witch-king orders his captain to "send forth all legions" and annihilate the population of Minas Tirith, saying that he himself will "break" the wizard Gandalf. Denethor, ill-pleased by Faramir's failed defence of Osgiliath, manipulates him into taking a doomed ride to reclaim the city. Gollum continues to play the hobbits against each other, this time by blaming Sam for eating their food provisions. Frodo, in his deluded state, is suspicious of Sam and orders him back home when Sam, trying to be helpful, offers to carry the Ring, thereby fulfilling Gollum's cunning prediction. Faramir rides head-long into the arrows of the encamped orcs as Pippin sings for Denethor who unconcernedly eats his noon meal. Faramir's attack fails and Faramir is dragged back by his horse in a death-like coma.
At the weapon-take at Dunharrow, a hooded figure slowly rides on a white horse along the winding road to the encampment in the hills. The figure reveals himself to Aragorn as Elrond. He presents Aragorn with his birthright -- the newly reforged sword Narsil, now named Anduril, Flame of the West. He urges Aragorn to use this sword to recall the Dead Men of Dunharrow and use their allegiance to the heir of Isildur (i.e. Aragorn) to stop the attack of the Corsairs' ships, which are already sailing from the south. Aragorn accepts this counsel and rides off that very night into the Dimholt, along with Legolas and Gimli. As he is preparing to go, a tearful Éowyn comes to Aragorn and begs him not to go, declaring her love for him, but Aragorn, knowing now that Arwen has refused the promise of Valinor, likewise refuses Éowyn's love. The next morning, Théoden rides off to war with six thousand riders, unaware that Éowyn and Merry, who were both told to remain behind by the King, are part of his army.
The Morgul forces, composed mostly of Orcs, begin the siege of Minas Tirith by catapulting the heads of captured prisoners over the walls. Denethor sees his son Faramir and believes him to be dead; he also beholds the might of the forces marshaled against him and at this he loses hope and his mind, ordering the Gondorians to abandon their positions. Gandalf, however, steps in and incapacitates Denethor, assuming control of the defense. A skirmish between Gondorian trebuchets and Mordor's catapults ensues until the Witch-king and the other Ringwraiths on their Fell Beasts attack, destroying the trebuchets and sewing terror among the defenders.
Away in Cirith Ungol, Gollum betrays Frodo to the giant spider-creature Shelob, but Sam returns to fight her off. Sam believes Frodo is dead, but when Orcs from the Tower of Cirith Ungol come and investigate, Sam overhears that Frodo has only been paralysed by Shelob's stinger.
In Minas Tirith, Denethor, stricken mad with grief at having spent both his sons, prepares a funeral pyre for himself and the unconscious Faramir. Denethor is unaware that Faramir is not dead and the pyre will burn him alive. Gandalf and Pippin arrive in the Hallows and manage to save Faramir, but Denethor is thrown onto the pyre and as he burns to death, he turns and sees his son stirring awake from his injuries and exhaustion. Down in the city, the battle goes ill with the Gondorians, as the huge battering ram Grond shatters the gates of the city and trolls pour in. As the defenders retreat to the upper levels of the city, the orcs crawl through the streets of the lower levels, looting, burning and massacring the men of Gondor. But suddenly in the midst of the chaos a lone horn penetrates the air and all turn to the west and see the army of Rohan arrive at last, to the rising of the sun. The Rohirrim charge into the Orcs with great effect. However their joy is cut short by the arrival of the forces of Harad and the immense elephants, the Mûmakil. The Witch-king descends on Théoden, killing Snowmane his horse and fatally wounding the King. Seemingly in the nick of time, the Corsairs' ships arrive to help the stranded Orcs, but it is Aragorn who jumps off the lead ship, followed by an army of the dead. They completely destroy the Orcs and Mûmakil, while Éowyn and Merry kill the Witch-king. Théoden dies of his wounds and Aragorn holds the Dead Army's oath fulfilled, releasing them from their curse so that they may rest in peace.
Sam rescues Frodo from Cirith Ungol, which is mostly empty following a fight between the two factions of the Tower's Orc garrison over Frodo's valuable mithril shirt. They begin the long trek across Mordor to Mount Doom. Gandalf realizes that ten thousand Orcs stand between Cirith Ungol and Mount Doom, which will prevent Frodo from reaching his destination. Aragorn proposes they lead the remaining soldiers to the Black Gate to draw the Orcs away from Frodo's path, as well as distract the Eye of Sauron. Sam carries Frodo up to Mount Doom, but Gollum arrives and attacks them, just as the Battle of the Morannon begins. At the Crack of Doom, Frodo, instead of dropping the Ring into the fire, succumbs to its power and puts it on, disappearing from sight. The act alerts Sauron, who sends the Ringwraiths racing towards Mount Doom. Gollum renders Sam unconscious then attacks Frodo, seizing his ring finger and biting it off. As Gollum rejoices at finally having reclaimed his Precious, Frodo, still under the sway of the Ring's attraction, charges at Gollum. After a brief struggle, they both fall over the edge of the precipice. Gollum falls into the fire with the Ring, while Frodo barely hangs on with his strength failing. Sam rescues Frodo as the Ring finally sinks into the lava and is destroyed. Sauron's Eye screams as his essence fades before the tower of Barad-dûr collapses and then explodes, forever banishing his power. The Orcs, Ringwraiths and the remaining forces of Sauron are consumed in the ensuing shockwave as the earth collapses under their feet; the Black Gate and Mordor are both shaken apart. Frodo and Sam become stranded when the entire top of Mount Doom is blown off in a large eruption. They voice their regrets at not being able to see the Shire again amidst the torrents of lava and the destruction of Barad-dur. With the destruction of the Nazgul, Gandalf is able to call upon the Eagles to carry the hobbits to safety. They awake in Minas Tirith, reuniting with the other members of the fellowship, all of them but Boromir having survived the War of the Ring.
In Minas Tirith, Aragorn is crowned King of the West, heralding the new age of peace, and marries Arwen. Here is when everybody kneels down in homage to the little hobbits. The hobbits return to the Shire, where Sam marries Rosie Cotton (Sarah McLeod). Frodo, having finished writing his entry in the Red Book of Westmarch, is still suffering from the effects of the wounds he received from the Ringwraiths at Weathertop and from Shelob. Realizing that he will never have peace in Middle Earth, he decides to go with Gandalf, Bilbo, Elrond, and Galadriel to the Grey Havens and sail to Valinor, the Undying Lands. Before embarking at the havens, Frodo passes the Red Book to Sam to record the years of his life to come. Then the last ship to leave Middle Earth sets off, pulling slowly away from the shore and passing along the Straight Road into the Uttermost West. Pippin and Merry take their leave and Sam is left staring into the golden sunset. In the last scene, Sam walks back up the lane to Bag End, where he is greeted by his wife Rosie, and his children. Surrounded by his family and with the rest of his life ahead of him, Sam sighs and says "Well, I'm back." He goes inside and shuts the door as the screen fades to black.