In 4 ABY, Darth Vader was sent to the incomplete Death Star II to await the Emperor, who was coming for an inspection tour. After Palpatine's arrival, Vader was sent to command the Imperial Fleet guarding the Death Star, keeping it on the far side of Endor. It was here that he sensed the arrival of his son, Luke Skywalker, along with the Rebel strike team coming to destroy the shield generator that protected the Death Star. When he informed the Emperor of this, Palpatine advised him to go to Endor and await Luke.
During his departure to Endor, it is said that he looked back on his life and had the first dream he had in many years. This was following visions that he thought were premonitions of the near future.
Arriving on the eve of Luke's capture, Vader once again attempted to persuade Luke to join the dark side, but this time Vader's interests were tinged by a desire to protect his son. When this failed, Vader took him to Emperor Palpatine himself on the incomplete Death Star II. Luke reluctantly fought a lightsaber battle with Vader, matching Vader's mastery of Form V with his own display of Form V blade work, all the while attempting to persuade his father into renouncing the dark side of the Force. In allowing this to happen, Luke Skywalker risked everything in order to assure the victory of the Rebel Alliance and the redemption of his father to the light.
During this time, Palpatine relentlessly attempted to lure Luke to the dark side, tormenting him with thoughts of the defeat of the Rebel Alliance and the death of his friends. However, Luke continued to attempt to restrain himself from fighting his father. Vader, who had been probing Luke's thoughts, discovered that besides Luke he also had a daughter: Leia Organa, Luke's twin sister. Vader, happy at this new information he had acquired, decided to use this knowledge against Luke, threatening to corrupt Leia. Luke, enraged, ignited his lightsaber and viciously attacked Vader with anger and hatred. Finally, Luke sliced off Vader's mechanical right hand, defeating the Dark Lord. Palpatine, cackling with triumph, urged Luke to fulfill his destiny, and take his father's place at the Dark Lord's side. Vader then realized that Sidious had betrayed him again, just as Darth Tyranus had been betrayed twenty-three years before, and just as he had been betrayed by Sidious for Galen Marek on the first Death Star.
Luke looked down to see his father's severed right hand, and, seeing that it was mechanical like his, he realized that he was about to become Vader's successor. Horrified at what he was about to do, Luke used a combination of Kenobi's and Yoda's teachings and the light side of the Force to calm himself down. Luke tossed his lightsaber away, refusing the Emperor's offer to join him as his new apprentice, declaring that he was a Jedi like his father before him. Enraged at the failure of his plans, the Emperor unleashed a barrage of Force lightning attacks upon Luke. Defiant to the end, Luke suffered the wrath of Palpatine, and Vader, in no condition to battle, could do no more than watch as Luke Skywalker lay dying.
Skywalker had never forgotten the pain Count Dooku had once inflicted upon him with the lethal power of Force lightning, and could not bear to see his son in such agony. He had been unable to save his mother, he had let Mace Windu die under Palpatine's powers, he had murdered hundreds of Jedi, he had killed his Master and best friend, he had lost his beloved wife and true love, but he could save his son. Anakin Skywalker would not stand by and let his son fall. From this moment on, Darth Vader was no more, and Anakin Skywalker was reborn.
Refusing to watch his son die, Skywalker suddenly grabbed Sidious from behind and hoisted him from his feet. In a final effort of self-sacrifice, Skywalker stubbornly advanced; ignoring the agony his former master's Force lightning inflicted him as he went for the Death Star's reactor shaft. Staggering to his destination, he threw Darth Sidious down the shaft to his death before collapsing. Mortally weakened by the lightning, and with his life support system short-circuited and fried, Anakin Skywalker had paid for his act of defiance with his life. Yet this single act brought him back to the light side.
Luke, attempting to save his father's life, dragged the dying elder Skywalker to the hangar where his shuttle lay. Skywalker, knowing that he would die whether or not Luke managed to get him onto a ship, stopped his son.
Nearing death, Skywalker asked Luke to help him remove his mask, so that he could see his son with his own eyes, not through the lens filters of his mask. Luke helped disconnect the mask and saw his father's face for the first time. Beneath, Anakin Skywalker was bald, his hair follicles having been incinerated in Mustafar's flames, and the wounds from Mustafar's heat had not yet healed. However, his eyes were no longer the burning yellow of a Sith Lord, but the shining blue of his former self. Skywalker told Luke that he was right about him, there was good still in him; and to tell his sister, Leia, the same. With these last words, Anakin Skywalker died and became one with the Force. His last words behind the mask of Vader were especially telling as well—in response to Luke's protest that he would die without the mask, Skywalker responded "Nothing can stop that now. Just for once, let me look on you with my own eyes." These words constituted a final rejection of the lying promises of his master Darth Sidious, and a full embrace of the light side of the Force once again.
Luke escaped the exploding Death Star in a shuttle along with his father's armor and artificial remains, and reached the forest moon of Endor where Darth Vader's armor was cremated in the manner of a Jedi, since Skywalker's body had passed into the light. During the celebration, Luke saw a vision of a forgiven Skywalker; whole, and without the artificial body of Vader. Obi-Wan Kenobi and Yoda were next to him. His destiny fulfilled, Anakin Skywalker had passed on into the embrace of the light side of the Force.