Jedi Master Obi-Wan Kenobi and Jedi Knight Anakin Skywalker lead a mission to rescue the kidnapped Supreme Chancellor Palpatine from the cyborg Separatist commander General Grievous. After infiltrating Grievous' flagship, the Jedi battle Sith Lord Count Dooku, who Anakin overpowers and decapitates at Palpatine's urging. Grievous escapes the battle-torn ship, which the Jedi crash-land on Coruscant. There, Anakin reunites with his wife, Padm� Amidala, who reveals that she is pregnant. While initially excited, Anakin soon begins to have nightmares about Padm� dying in childbirth.
Palpatine appoints Anakin to the Jedi Council as his personal representative. The Council, suspicious of Palpatine, allows Anakin as a member, but declines to grant him the rank of Master and instead instructs him to spy on Palpatine, diminishing Anakin's trust in the Jedi. Palpatine tempts Anakin with his knowledge of the Force, including the power to prevent death. Meanwhile, Obi-Wan travels to Utapau, where he kills Grievous, and Yoda travels to the Wookiee homeworld of Kashyyyk to defend it from a Separatist invasion. When Palpatine reveals that he knows the ways of the dark side of the Force and claims that he has the power to save Padm�'s life, Anakin deduces that he is the Sith Lord behind the war and reports Palpatine's treachery to Mace Windu, who confronts and subdues him. Fearing that he might lose Padm, Anakin disarms Windu as he is about to strike the killing blow, allowing Palpatine to send Windu falling to his death. Desperate, Anakin pledges himself to the Sith, and Palpatine dubs him Darth Vader.
Palpatine then issues Order 66, which commands the clone troopers to kill their commanding Jedi officers, thus sending the Jedi Order into near-extinction. Meanwhile, Vader and a battalion of clone troopers kill the remaining Jedi in the Jedi Temple, after which Vader travels to the volcanic planet Mustafar to assassinate the Separatist leaders. Palpatine declares himself Emperor before the Galactic Senate, transforming the Republic into the Galactic Empire, and denounces the Jedi as traitors. Having survived the chaos, Obi-Wan and Yoda return to Coruscant and learn of Anakin's turn to the dark side. Yoda orders Obi-Wan to confront Vader while he faces Palpatine.
When Padm learns of Anakin's betrayal, she travels to Mustafar � with Obi-Wan having stowed away on her ship � and tries unsuccessfully to convince Vader to reject the dark side. Seeing Obi-Wan inside Padm�'s ship, and thinking that they are conspiring to kill him, Vader uses the Force to choke Padm into unconsciousness. Obi-Wan engages Vader in a lengthy lightsaber duel that ends with Obi-Wan severing his legs and left arm, leaving him at the bank of a lava flow. Obi-Wan picks up Vader's lightsaber, watches in horror as flames consume the fallen Jedi, and leaves him for dead.