The final film in the trilogy began with a backstory-flashback of how Smeagol (Andy Serkis) became the spindly Gollum, when he murdered (by strangulation) his fishing buddy - cousin and river Hobbit Deagol (Thomas Robins), who had discovered the Ring in mud at the bottom of a river; Smeagol claimed it was his birthday present; thereafter, he degenerated physically and mentally into a raw-fish eating creature called Gollum (because of the sound he made when swallowing).
Returning to the present, Sam, Frodo, and scheming, treacherous, schizoid guide Gollum continued their trek to Mount Doom in Mordor to destroy the Ring. Aragorn, Legolas, Gimli, and Gandalf arrived on horseback at Isengard, where they found long-lost hobbits Merry and Pippin. Ent Treebeard had taken over Saruman's former stronghold and kept the evil, weakened Wizard under guard in the tower. Curious Pippin found and soon after, in Rohan, gazed into Saruman's palantir (a magical crystal ball) and foresaw the future ("a glimpse of the enemy's plan") -- "a white tree in a courtyard of stone", interpreted by Gandalf as the burning Gondor city of Minas Tirith ("the City of kings") - the next location of Middle-Earth Men that Sauron would raze to the ground.
To warn them, Gandalf rode his white steed Shadowfax (with Pippin) to Minas Tirith, a three days' ride. Meanwhile, elf Arwen while enroute to Grey Havens changed her mind and returned to Rivendell after having a vision of bearing a son with lover Aragorn - there, she persuaded her father Elrond that she wished to live a mortal life and be with Aragorn, and convinced Elrond to re-forge King Elendil's (and heir Isildur's) Narsil sword (it had overthrown Sauron many years earlier, but was in shards) - for the new king (it was later presented to Aragorn to summon an army to fight against Sauron).
Gandalf and Pippin arrived at Minas Tirith (the new capital of Gondor) - a seven-story structure of buildings and winding streets and passageways, where Gandalf met with grieving steward of the throne King Denethor (John Noble), lamenting the death of his son Boromir. Gandalf warned of coming war and told the uncooperative Denethor to light the beacons to alert neighboring armies. Denethor would not obey, distrusting the next rightful heir to kingship, Aragorn, who was aligned with Rohan (Denethor insisted: "The rule of Gondor is mine and no other's").
The Witch-king of Angmar, the "deadliest" Lord of the Nazgul (one of Sauron's nine slaves), who had stabbed Frodo earlier, kept his liar at Minas Morgul (the "Dead City") - he would lead Mordor's armies of Orcs in war ("the great battle of our time"). at the entrance to Minas Morgul, Gollum led Frodo and Sam up stone stairs toward a tunnel to enter into Mordor, triggering a beam of light toward the heavens. Meanwhile, at the ruins of Osgiliath (the former capital of Gondor), Orcs attacked as part of their plan to overrun the city and use it as a base from which to attack Minas Tirith. Gondor's Faramir (Boromir's younger brother) was unable to hold and defend the city, as hordes of Orcs crossed the river. Prompted by Gandalf, Pippin ignited Gondor's beacon - setting in motion of series of beacon-lights ("Hope is kindled") that reached to Rohan, warning King Theoden and Aragorn to aid Gondor by gathering their Rohirrim horse-warriors and others (6,000 strong) within two days at Dunharrow.
Gollum tricked Frodo into being suspicious about his friend Sam and separated the two - Sam departed after being told: "Go home". Faramir was ordered by his deluded father King Denethor to unwisely try to re-take Osgiliath, and he suffered a life-threatening wound. With Gimli and Legolas, Aragorn left King Theoden and took the deadly evil Path of the Dead (the under-mountain road to the Dimholt), populated with cursed, zombie-like dead traitors and murderers whose Army of the Dead (led by Paul Norell) would only answer to the King of Gondor (with the newly forged Narsil sword). They were persuaded to join Aragorn's forces, to regain their honor and be released from their curse (they were once cursed by Isildur).
The overwhelming siege began on Minas Tirith, with catapults, an attacking swarm of Orcs, giant trolls, Ringwraiths-Nazgul on flying winged creatures, fiery bombs, and a fiery wolf-battering ram against the gates, as Gandalf attempted to rally the outnumbered men. In the citadel of the besieged city, an unconscious Faramir was saved from cremation on a funeral pyre, and his insane father (engulfed in flames) jumped to his death.
After climbing the stairs and arriving at a tunnel, Gollum persuaded Frodo to enter Shelob's Lair where he was attacked by a giant demon spider that wrapped him in webbing and sedated him with poison. Realizing he was tricked by Gollum, Sam returned to save Frodo and fight off the spider with Bilbo's sword (Sting) - and fearing that Frodo was dead, he took the ring for safe-keeping. Frodo was seized by Orcs and taken into the Tower of Cirith Ungol. After realizing that Frodo was not dead, Sam followed behind.
King Theoden's Rohirrim horse-riders appeared on the horizon to provide more defense for Minas Tirith and open up other fronts, although the Witch-king counter-attacked in the Battle of Pelennor Fields with giant, multi-tusked pachyderms Oliphaunts (or Mumakil). Masquerading as a soldier to sneak into the battle, Theoden's niece Eowyn ("I am no man") killed the Witch-king to protect her lethally-wounded uncle who shortly later died of his injuries. The tide of battle turned when Aragorn arrived with the Dead Men Army and routed the Orcs, and then released them from their curse ("I hold your oath fulfilled. Be at peace").
In the Tower of Cirith Ungol where Frodo was held, Sam fought off a few Orc guards to rescue his friend - the two then set off for their final leg of the trip through Mordor to Mount Doom (without Gollum) to dispose of the Ring. To create a diversion, Aragorn proposed taking his remaining forces to the Black Gates of Mordor, to draw off Mordor's and Sauron's 10,000 Orcs so that Frodo (if still alive) could proceed safely ("Keep Sauron's Eye fixed upon us"). At the Gates, Aragorn dedicated the battle: "For Frodo" as he led the charge.
At the doorway to the volcanic area of Mount Doom, Gollum attacked Sam and Frodo, and wrestled for possession of the ring; he bit into and severed Frodo's finger to get the Ring, but its cursed power took effect as he celebrated possessing it once again ("Precious"). They struggled more and Gollum fell backwards to his death into the volcano's Crack of Doom while clutching the Ring to himself (Frodo was saved by hanging onto the cliff's edge) - ending its awesome dark power (and the power of Sauron, signified by the collapse of the Tower of Barad-dur and the end of the battle due to shockwaves and earthquakes). Gandalf saved Sam and Frodo with an Eagle from the volcano's destructive path of lava.
Everyone was reunited at Minas Tirith - and Aragorn was crowned the new King with a loving Arwen in attendance, and everyone bowed down to the four Hobbits ("My friends. You bow to no one"). The hobbits returned to their shire, where Sam married Rosie Cotton (Sarah McLeod) and Frodo wrote the story of the Lord of the Rings. In the tearful finale, Frodo left Middle-Earth with his elderly uncle Bilbo Baggins (Ian Holm), and was also accompanied by Gandalf - who bid farewell to the rest of the Fellowship (Frodo's three Hobbit friends), and then told Frodo: "It is time, Frodo", before departing with him for the Grey Havens (the elves' Undying Lands). The film ended with Sam joining his new wife and family in their Shire home.