In The Phantom Menace, 25-year-old Obi-Wan accompanies Qui-Gon on a mission to Naboo, a planet ruled by Queen Padmé Amidala. After making an unscheduled landing on Tatooine, his master stumbles upon Anakin Skywalker, a young slave who shows tremendous potential with the Force. Believing the boy to be the prophesied "Chosen One" who would bring balance to the Force by destroying the Sith, Qui-Gon asks the Jedi Council that the boy to be trained as a Jedi. Obi-Wan is also amazed by Anakin's unprecedented midi-chlorian count and strong Force potential, but initially thinks he should not be trained, believing the boy is already too old and has too many emotional attachments to become a Jedi. The Jedi Council agrees, and forbids training for Anakin, in whom they see a great deal of fear and anger.
During the film's climactic battle scene, Queen Amidala and her entourage of guards split up from her Jedi bodyguards when the Sith Lord Darth Maul arrives to eliminate the Queen. Wielding a double-bladed light saber, Maul simultaneously battles both Qui-Gon and Obi-Wan. After being separated from the duel via laser walls, Obi-Wan watches in horror as Maul impales his master. Obi-Wan engages Maul in a fierce duel, cutting Maul's light saber in half, but the Sith Lord knocks Obi-Wan into a reactor chasm and kicks his light saber into the depths below. Obi-Wan grabs onto an extending pole, breaking his fall. He then calms himself and reconnects with the Force, utilizing it to hurl himself into the air and simultaneously bring his master's light saber into his hand, startling Maul and giving him just enough time to slash the Sith Lord in half. The dying Qui-Gon tells Obi-Wan to train Anakin to be a Jedi, and Obi-Wan promises that he will.
For his heroics in defeating a Sith (making him the first Jedi in 1,000 years to do so), Yoda personally bestows the rank of Jedi Knight upon Obi-Wan, who then says that he would take it upon himself to train Anakin whether the Council allowed him to or not. Yoda reluctantly agrees, but warns Obi-Wan to be careful with the troubled boy.
In Attack of the Clones, set 10 years later, Obi-Wan has become an experienced Jedi Knight. By this time, his relationship with his padawan is strained; Anakin has grown powerful but arrogant, and believes that his Master is trying to hold him back.
He and Anakin are tasked with protecting Padmé, now a Senator, after an attempt is made on her life. Obi-Wan tracks the mysterious assassin to the planet Kamino, and learns about a massive clone army that the planet's inhabitants are building for the Galactic Republic. He then meets with the bounty hunter Jango Fett, the template for the clones, and figures out that he is the one responsible for the assassination attempts on Padmé. Obi-Wan attempts to apprehend Fett, who escapes to Geonosis with his unaltered clone Boba. Obi-Wan follows them by placing a homing beacon on Fett's ship, Slave I.
On Geonosis, Obi-Wan learns of the Confederacy of Independent Systems, also known as the Separatists, a conspiracy of star systems that wants to secede from the Republic. The renegades are led by rogue Jedi Count Dooku, who was once Qui-Gon's master. Obi-Wan is captured shortly after sending a message to Anakin. While in captivity, Dooku reveals that the Galactic Senate is under the control of a Sith Lord called Darth Sidious.
Later, Anakin and Padmé arrive on Geonosis to rescue Obi-Wan. They are themselves captured, however, and all three are sentenced to death by the Geonosians. The executions are prevented by the timely arrival of Jedi and clone reinforcements, led by Jedi Masters Mace Windu and Yoda. Obi-Wan and Anakin confront Dooku and engage him in a lightsaber duel. Dooku strikes Anakin with Force lightning, then turns the deadly barrage onto Obi-Wan, who easily blocks the attack with his lightsaber. The two duel and Dooku outmaneuvers Obi-Wan, striking him on both his left arm and leg. Dooku is about to deliver a killing blow when Anakin recovers from the lightning and blocks Dooku's attack. Dooku and Anakin fight a short duel, and Dooku cuts off Anakin's right arm (which is later replaced by a robotic prosthetic). Yoda arrives and fights Dooku as well, but the Sith escapes; he creates a distraction by nearly killing Obi-Wan and Anakin.
Revenge of the Sith
In Revenge of the Sith, set three years later, Obi-Wan and Anakin board the Separatist leader General Grievous' flagship, the Invisible Hand, and fight their way to the captive Chancellor Palpatine. There, they find Dooku, who engages them both in a duel. During the duel, Obi-Wan is rendered unconscious, leaving Anakin to face Dooku alone. Anakin defeats Dooku and, at Palpatine's urging, executes the defenseless Count, in violation of the Jedi Code.
When Palpatine appoints Anakin to the Jedi Council as his representative, the Council disapproves, considering Anakin too young and headstrong, and reasons that his membership gives the Chancellor a vote in Jedi affairs. Anakin protests when the Jedi Council denies him the rank of Master and orders him to spy on Palpatine, but Obi-Wan talks him into accepting it, warning Anakin of his "dangerous" friendship with the Chancellor.