During the conflict, it is revealed that Tobi is Obito Uchiha, a former teammate of Kakashi's who was thought to be dead. The real Madara saved Obito's life, and they have since collaborated. As Sasuke learns the history of Konoha, including the circumstances that led to his clan's downfall, he decides to protect the village and rejoins Naruto and Sakura to thwart Madara and Obito's plans. However, Madara's body ends up possessed by Kaguya Otsutsuki, an ancient princess who intends to subdue all humanity. A reformed Obito sacrifices himself to help Team 7 stop her. Once Kaguya is sealed, Madara dies as well. Sasuke takes advantage of the situation and takes control of all the Tailed Beasts, as he reveals his goal of ending the current village system. Naruto confronts Sasuke to dissuade him from his plan, and after they almost kill each other in a final battle, Sasuke admits defeat and reforms. After the war, Kakashi becomes the Sixth Hokage and pardons Sasuke for his crimes. Years later, Kakashi steps down while Naruto marries Hinata Hyuga and becomes the Seventh Hokage, raising the .