Eight-year-old Bruce Wayne falls into a cave, where he encounters a swarm of bats. Having developed a fear of bats, he urges his parents to leave an opera featuring bat-like creatures. Outside the theater, they are mugged by Joe Chill, who proceeds to kill the parents. Although Chill is later arrested, Bruce blames himself for his parents' murders.
Years later, Bruce returns to Gotham City from Princeton University, intent on killing Chill, whose prison sentence is being suspended in exchange for testifying against mobster Carmine Falcone. Before he can act, a woman posing as a reporter kills Chill for Falcone. Bruce tells his childhood friend Rachel Dawes about his plan, and she expresses disgust for his disregard for justice.
The opening crawl reveals that the Galactic Republic is in crisis. A separatist movement, led by former Jedi Master Count Dooku, has threatened the peace. Senator Padmé Amidala, former Queen of Naboo, returns to the Galactic Senate to vote against the creation of an Army of the Republic. Upon her arrival at Coruscant, she narrowly escapes an assassination attempt, a bomb placed on her ship. As a result, Chancellor Palpatine requests that she be put under the protection of Jedi Knight Obi-Wan Kenobi and his apprentice, Anakin Skywalker. That night, Zam Wesell, a bounty hunter, makes another attempt on Padmé's life, but Wesell is herself killed (to silence her) just after Obi-Wan and Anakin capture her. The Jedi Council sends Obi-Wan to investigate the murder, while Anakin is to protect Padmé by escorting her to Naboo. Anakin welcomes the opportunity; he often becomes angry at and frustrated with Obi-Wan's criticism, and is glad to have an opportunity to be alone with Padmé. Representative Jar Jar Binks assumes the Senator's duties in her absence.
The investigation leads Obi-Wan to the planet of Kamino, where he discovers that a secret clone army is being developed for the Republic. The Kaminoan Prime Minister tells him that this army was ordered some ten years ago by a Jedi Master named Sifo-Dyas, whom the Jedi Council believes to have been killed around the same time. A bounty hunter named Jango Fett had been hired to be the template for the clone. Obi-Wan meets Jango on Kamino, and believes that he is the killer he has been tracking. After unsuccessfully trying to capture Jango Fett, Obi-Wan places a tracking device on his ship and follows him to the planet of Geonosis. Meanwhile, Anakin and Padmé spend time together on Naboo, and Anakin reveals his love for her. Padmé resists, explaining that it would be impossible for the two of them to be together; she is a respected Senator, and the Jedi Code forbids marriage or any other form of attachment. Anakin is soon troubled by dreams in which his mother, Shmi, is in danger and dying. He asks Padmé to accompany him to Tatooine. Upon arriving, he learns that his mother had been kidnapped one month earlier by local Tusken Raiders. Anakin tracks her to a Tusken camp, where he finds her in poor condition, and within moments she dies in his arms. In a fit of rage, he slaughters the entire Tusken community, including the women and children (Master Yoda hears the voice of the deceased Qui Gon Jinn trying vainly to dissuade Anakin from the slaughter). Anakin brings his mother's body back to her home, where her funeral is held.
On Geonosis, Obi-Wan learns that Count Dooku and Nute Gunray have built a new droid army and that Gunray has ordered the assassination of Padmé. Just before being captured, Obi-Wan relays this information to Anakin so that he can relay it to the Jedi Council on Coruscant. Once the Jedi learn of Dooku's army, Jedi Master Mace Windu leads a team to Geonosis. Meanwhile, Jar Jar Binks calls for Chancellor Palpatine to be given emergency powers, with which he can call the recently discovered clone army into battle. Back on Geonosis, Count Dooku tries to persuade Obi-Wan to join him, warning him that the Senate is secretly under the control of a mysterious Sith Lord by the name of Darth Sidious. Obi-Wan refuses to believe him, saying that the Jedi would have known if that was the case. Upon learning that Obi-Wan is in trouble, Anakin and Padmé go to Geonosis, but they are captured during their infiltration of a droid factory, despite Anakin's valiant efforts. They join Obi-Wan in an arena-like complex where three monstrous creatures (a Reek, a Nexu and an Acklay) are unleashed on them for their execution. During their struggle against the beasts, Mace Windu arrives with the Jedi, and they battle the droid army. Combat begins with Windu and Jango Fett dueling (in which Windu beheads Fett). Just as defeat for the Jedi seems imminent, Yoda arrives with the Republic's new clone army.
A large battle erupts between the Republic's clone forces and the Separatists' droid army. Count Dooku attempts to escape, but Obi-Wan and Anakin track him to a secret hangar, where they engage him in combat. Dooku quickly injures Obi-Wan and cuts off Anakin's right arm. Yoda arrives and engages Dooku in lightsaber combat. Dooku, realizing he may be outmatched, causes a support pylon to nearly fall on Anakin and Obi-Wan; Yoda uses the Force to stop this, allowing Dooku to escape with the plans for a new weapon, the Death Star. In a desolate industrial district on Coruscant, he meets with his master, Darth Sidious, who is pleased that the war has begun "as planned". Dooku is revealed to be the apprentice Sith Lord, Darth Tyranus. On Coruscant, Obi-Wan informs the Jedi Council of Dooku's warning that Darth Sidious is controlling the Senate. All of them, including Yoda, are hesitant to believe this, stating that the Sith's traits have them creating fear and mistrust. Yoda and Windu also agree that the Dark Side is now clouding everything, and that they should closely monitor the Senate. Meanwhile, Palpatine oversees the launching of a massive clone trooper force. On Naboo, Anakin (with a new mechanical hand) and Padmé hold a secret wedding, to which only the droids C-3PO and R2-D2 are witnesses.