The original trilogy begins with the Galactic Empire nearing completion of the Death Star space station, which will allow the Empire to crush the Rebel Alliance, an organized resistance formed to combat Emperor Palpatine's tyranny. Palpatine's Sith apprentice Darth Vader captures Princess Leia, a member of the rebellion who has stolen the plans to the Death Star and hidden them in the astromech droid R2-D2. R2, along with his protocol droid counterpart C-3PO, escapes to the desert planet Tatooine. There, the droids are purchased by farm boy Luke Skywalker and his step-uncle and aunt. While Luke is cleaning R2, he accidentally triggers a message put into the droid by Leia, who asks for assistance from the legendary Jedi Knight Obi-Wan Kenobi. Luke later assists the droids in finding the exiled Jedi, who is now passing as an old hermit under the alias Ben Kenobi. When Luke asks about his father, whom he has never met, Obi-Wan tells him that Anakin Skywalker was a great Jedi who was betrayed and murdered by Vader. Obi-Wan and Luke hire the smuggler Han Solo and his Wookiee co-pilot Chewbacca to take them to Alderaan, Leia's home world, which they eventually find has been destroyed by the Death Star. Once on board the space station, Luke and Han rescue Leia while Obi-Wan allows himself to be killed during a lightsaber duel with Vader; his sacrifice allows the group to escape with the plans that help the Rebels destroy the Death Star. Luke himself (guided by the power of the Force) fires the shot that destroys the deadly space station during the Battle of Yavin.
Three years later, Luke travels to find the Jedi Master Yoda, now living in exile on the swamp-infested world of Dagobah, to begin his Jedi training. However, Luke's training is interrupted when Vader lures him into a trap by capturing Han and his friends at Cloud City. During a fierce lightsaber duel, Vader reveals that he is Luke's father and attempts to turn him to the dark side of the Force. Luke escapes and, after rescuing Han from the gangster Jabba the Hutt, returns to Yoda to complete his training; only to find the 900-year-old Jedi Master on his deathbed. Before he dies, Yoda confirms that Vader is Luke's father. Moments later, the Force ghost of Obi-Wan tells Luke that he must confront his father once again before he can become a Jedi, and that Leia is his twin sister.
As the Rebels attack the second Death Star, Luke engages Vader in another lightsaber duel as the Emperor watches; both Sith Lords intend to turn Luke to the dark side and take him as their apprentice. During the duel, Luke succumbs to his anger and brutally overpowers Vader, but controls himself at the last minute; realizing that he is about to suffer his father's fate, he spares Vader's life and proudly declares his allegiance to the Jedi. An enraged Palpatine then attempts to kill Luke with Force lightning, a sight that moves Vader to turn and kill the Emperor, suffering mortal wounds in the process. Redeemed, Anakin Skywalker dies in his son's arms. Luke becomes a full-fledged Jedi, and the Rebels destroy the second Death Star.
The prequel trilogy begins (32 years before the original film) with the corrupt Trade Federation setting up a blockade of battleships around the planet Naboo. The Sith Lord Darth Sidious had secretly planned the blockade to give his alter ego, Senator Palpatine, a pretense to overthrow and replace the Supreme Chancellor of the Galactic Republic. At the Chancellor's request, the Jedi Knight Qui-Gon Jinn and his apprentice, a younger Obi-Wan Kenobi, are sent to Naboo to negotiate with the Federation. However, the two Jedi are forced to instead help the Queen of Naboo, Padmé Amidala, escape from the blockade and plea her planet's crisis before the Republic Senate on Coruscant. When their starship is damaged during the escape, they land on Tatooine for repairs, where Qui-Gon discovers a nine-year-old Anakin Skywalker. Qui-Gon comes to believe that Anakin is the "Chosen One" foretold by Jedi prophecy to bring balance to the Force, and he helps liberate the boy from slavery. The Jedi Council, led by Yoda, reluctantly allows Obi-Wan to train Anakin after Qui-Gon is killed by Palpatine's first apprentice, Darth Maul, during the Battle of Naboo.
The remainder of the prequel trilogy chronicles Anakin's gradual descent to the dark side as he fights in the Clone Wars, which Palpatine secretly engineers to destroy the Jedi Order and lure Anakin into his service. Anakin and Padmé fall in love and secretly wed, and eventually Padmé becomes pregnant. Anakin has a prophetic vision of Padmé dying in childbirth, and Palpatine convinces him that the dark side of the Force holds the power to save her life. Desperate, Anakin submits to Palpatine's Sith teachings and is renamed Darth Vader.
While Palpatine re-organizes the Republic into the tyrannical Empire, Vader participates in the extermination of the Jedi Order, culminating in a lightsaber duel between himself and Obi-Wan on the volcanic planet Mustafar. Obi-Wan defeats his former apprentice and friend, severing his limbs and leaving him to burn to death on the shores of a lava flow. Palpatine arrives shortly afterward and saves Vader by placing him into a mechanical black mask and suit of armor that serves as a permanent life support system. At the same time, Padmé dies while giving birth to twins Luke and Leia. Obi-Wan and Yoda, now the only remaining Jedi alive, agree to separate the twins and keep them hidden from both Vader and the Emperor; until the time comes when Anakin's children can be used to help overthrow the Empire.