Obi-Wan Kenobi and 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 Count Dooku, whom 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 Jedi 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 says 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. Desperate to save Padmé’s life, Anakin disarms Windu as he is about to kill him, allowing Palpatine to send Windu falling to his death. 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 treachery, she travels to Mustafar – with Obi-Wan having stowed away on her ship – and tries convincing Vader to reject the dark side, to no avail. Sensing Obi-Wan’s presence, and thinking that they are conspiring to kill him, Vader angrily chokes Padmé. 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.
On Coruscant, Yoda battles Palpatine until their duel reaches a stalemate. Yoda then flees with Senator Bail Organa and regroups with Obi-Wan on the planetoid Polis Massa. Padmé gives birth to twins – whom she names Luke and Leia – and dies, still thinking there is good in Vader. On Mustafar, Palpatine retrieves a barely alive Vader and takes him to Coruscant, where his mutilated body is treated and covered in a black armored suit. When Vader asks if Padmé is safe, Palpatine says that he killed her out of anger, devastating Vader.
Obi-Wan and Yoda plan to conceal the twins from the Sith and go into exile until the time is right to challenge the Empire. As Padme’s funeral takes place on her homeworld of Naboo, Palpatine and Vader overlook the construction of the Death Star. Bail takes Leia to his homeworld of Alderaan, where he and his wife adopt her, while Obi-Wan delivers Luke to his step-uncle and aunt, Owen and Beru Lars, on Tatooine before going into exile to watch over the boy.