According to Madara, Nagato is a descendant of the Uzumaki clan.[4] During the Second Shinobi World War, Nagato lived with his parents in a village near Amegakure. One day two Konoha shinobi broke into their home looking for food, unaware that the place was still inhabited. Nagato's parents, believing they were going to be killed, attacked the two so that Nagato could escape. Having mistaken them to be enemy ninja, the Konoha ninja killed his parents. In his grief, Nagato awakened his Rinnegan and killed the assailants. He would come to consider this incident the first great pain of his life.[5] His family gone, Nagato wandered the country, going from house to house asking for food. In time he met a dog named Chibi and, later, Konan and Yahiko, who began traveling with him in his search for food. One day, Chibi was killed in the crossfire from Hanzō's fight with the soon-to-be Sannin. Nagato mourned his death and promised himself that he would change the world. When the war ended, the three orphans ran into the Sannin. Rather than return to Konoha with his team-mates, Jiraiya decided to teach the three how to look after themselves.Soon after Jiraiya began living with the orphans, Nagato and Yahiko were attacked by an Iwagakure ninja. Nagato reactivated his Rinnegan to defend Yahiko, killing the ninja. When Jiraiya found out about this, he decided to train them in ninjutsu.[6] Nagato was very emotional about killing the ninja, and asked Jiraiya for help so he could protect Konan and Yahiko. Jiraiya's response was for Nagato to grow up and to use his eyes to find the peace that they both desired for the world. Three years later the orphans had become competent ninja, so Jiraiya returned to Konoha.
Over the years, news of the three's exploits would reach Jiraiya which often consisted of the death of someone who opposed them; eventually he received word that they had all died.[7] In truth, Nagato, Konan, and Yahiko began a quest to find peace. They became full-fledged Amegakure ninja and gathered followers who shared their philosophies of an end to war. Hanzō, the leader of Amegakure, viewed the group as a threat to his rule and schemed with Konoha's Root to eliminate them. Claiming to want to discuss peace, Hanzō lured Nagato, Yahiko, and Konan to an ambush. There he forced Nagato to choose between killing Yahiko or Konan. Not wanting to force Nagato to make the choice, Yahiko impaled himself with a kunai that was placed in Nagato's hand. With Yahiko's dying breath, he told Nagato to survive, because he believed in Jiraiya's words that Nagato would become the world's savior. This would become the second great pain of Nagato's life.