Luke lives a humdrum existence on Tatooine with his aunt and uncle, who have kept his father's true history a secret from him. He initially wants to join the Imperial Academy to become an Imperial pilot with his childhood friend Biggs Darklighter, but is held back by his uncle who needs his help on the moisture farm. He takes his first steps toward his destiny when he finds two droids, C-3PO and R2-D2, the latter of whom is carrying a message for Obi-Wan Kenobi, known to Luke as the hermit old Ben Kenobi. Obi-Wan tells Luke that his father was a Jedi and presents him with his father's lightsaber. He then tells him that his father was murdered by a traitorous Jedi named Darth Vader. Obi-Wan offers to take Luke to Alderaan and train him in the ways of The Force, but Luke rejects his offer.
Luke changes his mind when he discovers his aunt and uncle have been killed by Imperial stormtroopers, however. He and Obi-Wan obtain passage with the smugglers Han Solo and Chewbacca on their ship, the Millennium Falcon, only to find that Alderaan has been destroyed by the Empire's new superweapon, the Death Star.
The group sneaks onto the Death Star and rescues the captive Princess Leia; as they are escaping, Obi-Wan sacrifices himself in a duel with Vader. Luke is heartbroken, but finds the strength (with help from Obi-Wan's spirit) to join the Rebel Alliance and destroy the Death Star during the film's climactic battle.
In Star Wars Episode V: The Empire Strikes Back, set three years later, Luke is now a lieutenant commander in the Rebel Alliance and in command of a fighter squadron. While on a mission on the ice planet Hoth, he is nearly killed by a Wampa; he escapes with the help of the Force and his lightsaber. In the frozen wasteland, he sees the spirit of Obi-Wan, who tells him to travel to the planet Dagobah and complete his training under Jedi Master Yoda.
When the Empire discovers the Rebel base on Hoth, Luke leads his squadron to cover the evacuation. Escaping Hoth in his X-wing, he travels to Dagobah, instead of regrouping with the Alliance. There, he meets Yoda and undergoes rigorous Jedi training, quickly increasing his power in the Force. However, he is warned that the Force is a double edged sword; its dark side is seductive and could corrupt him into an agent of evil if he gives into his anger and aggression.
His training is interrupted by a vision of his friends in pain. Against Obi-Wan and Yoda's advice, he travels to Cloud City to save them, only to be lured into a lightsaber duel with Darth Vader. As his mentors warned, Luke proves to be no match for Vader, who cuts off his right hand. The Sith Lord then reveals his true identity as Luke's father. Vader offers him the chance to turn to the dark side of the Force and rule the galaxy at his father's side. Horrified by this unexpected claim and the powerful temptation before him, Luke chooses to die rather than be corrupted and throws himself into a deep reactor chasm. However, he is sucked into a garbage chute to the underside of Cloud City and left hanging onto a weather vane. Leia, flying away from Cloud City in the Millennium Falcon, senses Luke's peril and turns the ship around to save him. Aboard the medical ship after rejoining the rebel fleet, Luke's missing hand is replaced with a prosthetic one.
A year after the events in The Empire Strikes Back, Luke, along with Leia, the droids, and Lando Calrissian, save Han Solo from the gangster Jabba the Hutt, who had acquired the carbonite-encased Solo. Luke offers to negotiate with Jabba, but instead is forced to fight a fearsome monster, the Rancor. When Luke kills it, Jabba sentences him to be thrown into The Pit of Carkoon, to be eaten by the Sarlacc. Luke escapes with R2's help, saving his friends and destroying Jabba's barge, with the aid of a new green lightsaber constructed following the loss of his first weapon in his duel with Vader.
During his return trip to Dagobah, Luke learns from the dying Yoda that Vader is indeed his father, and from Obi-Wan's spirit that he has a twin sister, which Luke immediately realizes is Leia. Obi-Wan warns him that his instincts "do him credit", but also warns him that they could be made to serve the Emperor. Yoda tells Luke that although he requires no further training, he will not truly be a Jedi until he confronts his father. Luke insists that there is still good left in Vader, and pledges to bring him back from the dark side. Obi-Wan, however, believes that Vader has completely consumed Anakin Skywalker, and must be destroyed in order to defeat the Empire.
Arriving on Endor as part of a Rebel commando squad, Luke surrenders to Vader in an attempt to bring his father back from the dark side of the Force. Vader rebuffs his entreaties and brings Luke to the Emperor on the second Death Star, in orbit around Endor. The Emperor and Vader attempt to turn Luke to the dark side with promises to save his friends from certain death. When that fails, the Emperor goads Luke to strike him down to save the Rebels, who are losing a battle with the Empire on and over the forest moon of Endor. Luke momentarily lashes out in anger, but Vader blocks his strike, and father and son face each other in a final duel. Luke keeps his emotions under control until Vader senses Luke's feelings for his sister and threatens to turn her instead. At this threat Luke finally gives into his anger and attacks with full fury. Vader loses ground as Luke lands blow after blow; Luke knocks Vader to the ground and severs his father's mechanical right hand. With the Emperor ordering Luke to strike Vader down and take his place, Luke glances at his own bionic hand and realizes he's on the verge of following the same path to the dark side as his father. Luke regains composure, deactivates his lightsaber and throws it away, proudly declaring his allegiance to the Jedi.
Enraged, The Emperor attacks Luke with Force lightning, nearly killing him. In horrible pain, Luke calls out to Vader for help. In an act of self-sacrifice, his father seizes the Emperor and throws him to his death down a reactor shaft. In the process, he is mortally wounded by the Emperor's lightning. As Rebel fighters and the Falcon race toward the Death Star's main reactor, Luke (at his father's request) removes the mask that had encased his face, and looks upon his father's eyes for the only time. A redeemed Anakin Skywalker dies moments later, assuring his son that there is still good in him after all. Luke escapes with his father's remains moments before the Death Star is obliterated. On Endor, in the manner of a funeral, Luke burns the last vestiges of his father that had been Darth Vader on a pyre, a Jedi tradition. During the Rebel Alliance's victory celebrations on Endor, Luke sees the smiling spirits of Obi-Wan, Yoda, and his father, Anakin Skywalker.