Nagato, known as Pain, was the recognized leader of the criminal organization Akatsuki(truthfully the group was led by Obito Uchiha). He, along with his partner Konan, and their deceased friend Yahiko, was one of the first students of the legendary Sannin Jiraiya.
At some point, Madara Uchiha transplanted his Rinnegan eyes into Nagato as a child, without him aware of it. Growing during the Second Shinobi World War in a village near Amegakure, Nagato's parents were killed one day by a pair Konohagakure shinobi who mistook them for the enemy, his parents having believed they were there to kill them. In his grief, Nagato then used the Rinnegan by mistake and killed the two shinobi. Wandering the land, in the company of a dog named Chibi, Nagato knocked at doors and begged for food, never receiving any. However, one day, as he collapsed from near starvation, Nagato was found by Konan, a young girl who gave him a loaf of bread. She led him to a hideout she and another boy, Yahiko, had established, but Nagato was at first not willingly welcomed. After Nagato expressed his wish of a peaceful world, Yahiko warmed up to him, as that was also his desire. To survive, the trio began to steal supplies, however, one day, during a fight between Hanzo and some Konohagakure shinobi, Chibi was killed. After the group mourned the dog's death, they, impressed by the three Konoha shinobi they had seen battling Hanzo, decided to seek them out, at Yahiko's decision. After they found them, the three legendary Sannin as Hanzo had named them, Jiraiya provided them food. Though Orochimaru was going to kill them to prevent them from suffering, Jiraiya decided to stay with them and care for them until they could do for themselves. Not long thereafter, a Chunnin of Iwagakure attacked Yahiko and Nagato, who, in desire to protect his friend, again used his Rinnegan by accident and killed the Chunnin. After Jiraiya arrived and saw his eyes, he decided to train the children as shinobi. Nagato went on to master all five chakra natures, as well as Yin Release, Yang Release, and Yin-Yang Release, which had never been rivaled. After three years, Jiraiya, impressed when Nagato and the others took out a shadow clone of him easily, decided to leave them to pursue their goals.
Throughout the years, news of their exploits reached their teacher, and while he believed they died in at some point, Nagato and Konan followed Yahiko into a mercenary group he founded called Akatsuki, in which they gathered folowers who shared their ideology about peace in the world. Their gained recognision Hanzo himself. At some point, the group was approached by Obito Uchiha, posing as his teacher , Madara Uchiha, and his partner Zetsu. Though Yahiko had his doubts about this masked man's identity, Nagato became interested in what Obito said about his Rinnegan and what he could with them. Bad luck soon arose, as Hanzo began to fear that Akatsuki would become a threat to his power and regime, and, working together with Danzo Shimura of Konohagakure, lured Nagato and his friends into a trap, wherein he forced Nagato kill Yahiko, or else Konan would die. Before he could, Yahiko impaled himself on Nagato's kunai, causing him to have a meltdown in which, after rescuing Konan, he summoned the Demonic Statue of the Outer Path, the empty vessel of the Ten-Tails, the original tailed beast, which he used to wipe out all of ZDanzo and Hanzo's men. Both of them escaped, however, leaving Nagato emaciated and unable to walk due to his legs being heavily damaged by Hanzo's attack. Nagato took over Akatsuki then and, severing all their ties with Amegakure, decided to show the world what pain was. Nagato created a technique called Six Paths of Pain technique by converting Yahiko's dead body, along with the bodies of other shinobi Jiraiya knew, in an attempt to regain his mobility. he went on to lead a civil war withinAmegakure against Hanzo, managing to eventually kill him and end his regime, before having anyone connected to him slaughtered, becoming what the people of Amegakure knew as a "god", ruling from the shadows.
Nagato, through his Deva Path(his friend Yahiko's body recrafted into his Six Paths of Pain technique), frequently appeared first in the series as a hologram, calling together his fellow Akatsuki members as leader of the group to seal various tailed beasts, such as Shukaku, the One-Tail, Matatabi, the Two-Tails, Isobu, the Three-Tails, and Son Goku, the Four-Tails. When his former teacher, Jiraiya, infiltrated his village Amegakure, through his Deva Path, he stopped the downpour of rain and had his partner Konan begin to look for Jiraiya, before switching the Deva Path with the Animal Path and following her. The Animal Path arrived in time to save Konan from Jiraiya, before beginning a brutal battle with the Sannin, who summoned Gamaken, a giant toad. Having summoned a giant chameleon, Nagato vanished, prompting Jiraiya to use his Barrier: Canopy Method Formation technique. Nagato went on to lose every summon he brought in to Jiraiya attacks and only managed to prompt him to activate Sage Mode. Realizing that summons alone would not be enough to defeat Jiraiya, Nagato had the Animal Path summon the Human and Preta Paths for assistance. Initially outmatching Jiraiya and his newly summoned partners, Shima and Fukusaku's efforts, the trio fell back, forcing the three Paths to pursue them. They formulated a plan to use genjutsu to paralyze the three Paths, which was successful and Jiraiya killed them. However, Nagato had a fourth, the Asura Path, tear off Jiraiya's arm and blast him through a wall, before having the Naraka Path revived the three slain bodies and confronting the handicapped Jiraiya with all of his Six Paths of Pain, including the Deva Path.
Proclaiming himself a god, Nagato had the six Paths attack Jiraiya, managing to overwhelm him. However, Jiraiya fell back into a barrier and recaptured the Animal Path, which he re-killed. After Jiraiya returned and recognized the Paths as shinobi he knew, Nagato had the Asura Path crush his throat and had the others pin Jiraiya to a stone slab. Though fatally wounded, Jiraiya managed to enscribe a message regarding Pain(Nagato's named under Akatsuki)'s identity, before the Aura Path destroyed the slab, and Jiraiya died in the depths below. Afterwards, Nagato held a brief moment of silence in respect for his former master's power, before later, through the Deva Path, holding a meeting with Obito Uchiha, posing as his teacher Madara Uchiha, who instructed him to capture the Nine-tails, Kurama's jinchuriki, Naruto Uzumaki. In the anime, the Six-Tails had not yet been captured and Pain captured him and the beast was later extracted. Afterwards, Nagato and Konan moved on to Konohagakure after Naruto, though they initially failed to find him or about his whereabouts and had many fights, with both the Asura and Naraka Paths defeated in battle, and the Deva Path being forced to defeat Kakashi Hatake, who died as a result. The Deva Path confronted Tsunade, the Fifth Hokage, who refused to reveal Naruto's location. However, the Human Path withdrew the information from Tsunade's assistant, Shizune, killing her in the process, and Nagato had the Deva Path level Konohagakure with a high scale version of his Shinra Tensei technique, also creating a giant crater.
Naruto then arrived back, with several giant Toads, and the Deva Path confronted him, soon joined by the rest of the Six Paths of Pain. As the Asura Path attempted to kill Tsunade, Naruto destroyed it, going on to overpower the Preta Path with his newfound Sage Mode powers. Naruto then destroyed the Human Path with his Rasenshuriken technique, but began to slow down. Before Naruto's Sage Mode wore out, with Gamabunta's help, he took out another of Nagato's Paths, the Animal Path, replaced by a woman body. The Deva Path then engaged Naruto directly, but the latter overpowered it after going back into Sage Mode through the aide of pre-existing shadow clones. He then attempted killit using the Rasenshuriken, but the Preta Path, revived by the Naraka Path, absorbed the attack. The Deva Path, praising Naruto's power, then pulled him up with his Bansho Ten'in technique and the Preta Path absorbed his Sage chakra, but turned into a statue doing so. The Deva Path then overpowered Naruto and pinned him to the ground, conversing with him afterwards. During this conversation, Nagato had his physical debut in the series, alongside his partner, Konan. With Naruto unable to answer his question as to how he would bring peace to the world after Pain's tragic story, he went on to state his resolve to create a weapon out of the tailed beasts to force the world to learn pain and deter war, as he believed was his duty to do, viewing himself as the "god of peace". Naruto objected to his method, and the Deva Path was quickly attacked by Hinata Hyuga, who tried to free Naruto. The Deva Path easily overpowered and defeated Hinata, enraging Naruto and causing him to release his four-tailed form, which allowed him to break free and give Pain an overwhelming challenge.
As the Deva Path proved not to be a match for Naruto at this point, being overpowered gradually, Nagato had it fall back far enough and used his Chibaku Tensei technique to create a gigantic sphere of earth that entrapped Naruto. Naruto, however, then released his eight-tailed form and broke out of it, to Pain's amazement. After the Nine-Tails mysteriously vanished, Naruto had entered Sage Mode before landing on the ground, Pain was shocked when he, just like Jiraiya, figured out the secret behind the Six Paths of Pain, he engaged Naruto again, who used the Rasenshuriken twice, with him managing to dodge it both times, before facing hoards of naruto's shadow clones transformed into rubble. He managed to overpower them, and tried to repel Naruto, who summoned more clones to hold him up, shocking Pain. Before he could recover enough to attack again, Naruto struck the Deva Path with his Rasengan technique and sent it crashing through stone, defeating all of the Six Paths of Pain. Later, Nagato himself was personally confronted by Naruto, who he told of his past and what led him to be what he was. However, to konan's surprise, naruto managed to reform Nagato, who used his Outer Path: Samsara of Heveanly Life technique to revive everyone he killed in Konohagakure. Afterwards, Nagato died from overdoing his power, entrusting Naruto to find a way to create a peaceful world, as he himself had failed to do so. Afterwards, Konan returned with Nagato and Yahiko's bodies to Amegakure, taking over as leader and leaving Akatsuki.
Nagato was later revived by Kabuto Yakushi, along with all his fellow deceased Akatsuki members, as a military weapon for Akatsuki's side. He, supported by Itachi Uchiha, eventually encountered Naruto again, sided by Killer B, the Eight-Tails, Gyuki's jinchuriki, who he commended for gaining control over Kurama's power. Though reluctant to fight Naruto again, Nagato was forced to engage him and B, being shocked during the fight when he learned of Itachi's reasons for what he did in Konohagakure. After summoning some of his strange creatures that shared his Rinnegan, Nagato went on to warn Naruto of Itachi's Amaterasu, and after a crow emerged from with Naruto, Itachi was freed of Kabuto's control, and he set Nagato ablaze with the Amaterasu. Later throwing the flames off of him with his Shinra Tensei, Nagato took refuge inside his cameleon's mouth and used a high-scale Shinra Tensei and attempted to attack b, who struck him with his lariat attack in his version 2 state of th Eight-Tails' cloak. Absorbing most of the chakra, which restored a more youthful appearence and mobility to Nagato, he tossed B aside and proceeded to try and pull out Naruto's soul, again overpowering B when he tried to help Naruto. Before he could do anything further to them, Itachi interveined and freed them from his grasp. Nagato then used his Chibaku Tensei to try and defeat the trio, which was countered by them each using their strongest, long-range attacks to destroy it. Nagato then found himself stabbed through by Itachi's Sword of Totsuka, and, after apologizing to Itachi, imparted his final words to Naruto as the sword sealed him away permenantly, with Nagato stating he would now rejoin Jiraiya in the afterlife. His sealing prompted Kabuto to then summon his trump card, Madara Uchiha, who went on to defeat the five Kage and overwhelming help Akatsuki's side.
Nagato, as a child, was very kind, sensitive, and loyal, as shown when he would cry at times easily, and in his attitude towards his childhood friends, Konan and Yahiko. He was horrified at the notion of death, even if he did it, albeit by accident with his Rinnegan. Growing into a man, he shared his friends and sensei, Jiraiya's views of peace and did anything for them. However, after Yahiko's death, which dramatically impacted Nagato, he became a very cruel, aloof, and cold man, believing himself a "god of peace" who was to teach the world pain. He hated Hanzo, the former leader of Amegakure who killed Yahiko, immensely, and killed not only him, but anyone connected to him as well. He also, given shinobi from that village were responsible for his parent's deaths, hate Konohagakure with a passion, but came to improve on this under Jiraiya's training. But after what happened to Yahiko, his animosity returned and he grew to bare an intense hatred of Konoha and Jiraiya, which resulted in him destroying the village in revenge for the pain caused to him. Nagato would kill anyone who stood in the way of Akatsuki's goals or anyone whe felt might become a threat to the group, as he killed Jiraiya and Kakashi Hatake for such reasons. He did, however, have respect for powerful shinobi, as he was honored to meet Kakashi and held a breif moment of silence in respect for Jiraiya's power after killing him. Nagato also ordered the resk of Akatsuki to mourn Deidara after his death, showing he always respected the dead.
After he was reformed by Naruto Uzumaki, he sacrificed his life to revive everyone he killed in Konohagakure and died with faith that Naruto could bring peace. After his revival, he showed a kinder and more jocular persona, commending Naruto's gain of control over Kurama, the Nine-Tails' power, which he claimed didn't surprise him, and making jokes about his lack of mobility, which seemed to surprise Naruto.
As the recognized leader of Akatsuki and a Rinnegan user, Nagato was an extraordinarily powerful shinobi, and was considered by Obito Uchiha to be the overall strongest member of Akatsuki. His partner, Konan, stated that Nagato, prior to fighting Naruto, had never been defeated and that he was invincible, which Obito seemed to agree with. Fukusaku, who fought in battle with his Six Paths of Pain, stated that without full understanding of Nagato's powers, it was not possible to defeat him. Nagato was able to easily kill his former master, Jiraiya, one of the legendary Sannin world-renowned for his power, after calling together all of the six Paths, having underestimated him beforehand and nearly lost because of it. After his revival by Kabuto during the Fourth Shinobi World War, it took the combined efforts of Naruto Uzumaki, Killer B, and Itachi Uchiha to finally defeat Nagato.
Nagato's power mainly came from his Rinnegan, a legendary dojutsu belonging to the Sage of the Six Paths, the first shinobi, which was given to him by Madara Uchiha. With it, he could use all the Sage's strange powers, including absorbing chakra, pulling and repelling objects, summoning strange summons with the Rinnegan in their eyes and mechanical parts from within his body, removing souls, reviving the dead, and mastering all forms of nature transformation. Nagato could also use the Chibaku Tensei technique of the Sage of the Six Paths, which allowed him to create a giant sphere of earth capable of overpowering just about anything. This power made Nagato an overwhelming opponent, easily outmatching and defeating Jiraiya and Hanzo, both two of the strongest shinobi of their times(though Hanzo might have won if he had continued to refine his power rather than rely on personal protection to preserve his skills), and pressing Naruto to the point of a near-stalemate in their first fight, despite the latter's various, incredible powers. Nagato's greatest and most common technique was his Six Paths of Pain, which were composed of dead bodies Nagato took and embedded chakra receiver rods into to allow him to control. Each held a unique Rinnegan power and when working together could almost be invincible. Only Naruto has ever defeated this technique. Nagato was very skilled in taijutsu, both through the Six Paths or personally, as he managed clash toe-to-toe with Naruto as an equal in taijutsu when the latter was not in Sage Mode and rescued Konan from Hanzo before the latter could react, but was crippled as a result. Nagato was an excellent tactician and could easily be considered a battle genius, able to easily master all five chakra natures himself and cleverly creat the Six Paths of Pain technique to compensate for his lack of mobility in battle, giving each body an adequate ability.