Jiraiya dies when he is battling Pain in Amegakure. Even though he dies in battle, he managed to send information regarding Pain back to Konoha. Jiraiya is one oh Konoha’s Legendary Sannin. He traveled the world in search of knowledge that would help the people he held dear.
After Jiraiya graduated from the Academy, he was put in team Hiruzen alongside Orochimaru and Tsunade. When Jiraiya was taken to meet the Great Toad Sage, he predicted that the ninja would travel a lot and then one day meet the Child of prophecy.
When Jiraiya led his team, he started to think that his student Minato Namikaze might be the child of prophecy. He thought that because Minato was a natural genius. After that he took in Minato as his student and during their journey together, they learned a lot of things, especially from each other.
After the third legendary Ninja war was over and three Sannin were returning, they came across three orphans. Jiraiya decided to stay back and train these orphans whose names were Nagato, Konan, and Yahiko. After spending a lot with Nagato, Jiraiya got to know that he possessed the Rinnegan which was used to save the world by the Sage of Six Paths centuries ago. Jiraiya then thought that Nagato might be the 'Child of Prophecy.'
Nagato to was an orphan who got caught up in the war that was going on. After the battle that took place in Amegakure, Jiraiya found him, Yahiko, and Konan but instead of killing them, he took them in as a students and started to train them.
After they were fully trained, he decided to leave as he thought the day we were ready enough to make their path in life. The three formed the rebel faction of Amegakure called the Akatsuki against Hanzo but in the process of negotiations, they lost Yahiko as Hanzo had tricked them.
However, Nagato later overthrew Hanzo and killed him in process, and took over Amegakure as their place for base operations.
The relationship between Jiraiya and Nagato was that of a master and a student. He took him in when they were on the brink of death and made it his mission to train him. When he got to know that Nagato possessed the rinnegan and started training him more.
After Jiraiya left them, they were sad and there was a bit of hate because after their final training he just left without saying a word and also that they are master wasn't there when they need it him the most. But the reason Jiraiya was killed was because of hate but because he knew too much about their plan and they couldn't risk it getting leaked out.
Before leaving Konoha, Jiraiya met up with Tsunade and informed her that he was leaving for Amegakure. This was because he believed that the leader of the Akatsuki resided there and left to gather some more information regarding the organization. Once Jiraiya entered Amegakure, he went around asking and talking to the people who lived in village, regarding their leader. He learned that Pain was their current leader after he had defeated Hanzo.
Within a few moments of entering Amegakure, Pain got to know that there was an intruder in the village. He orders Konan to search for the intruder. When she was scouting about, she notices Jiraiya and goes back immediately and informs Pain about Jiraiya's arrival in the village.
Konan went ahead and attacked Jiraiya, they turned out to be evenly matched. Jiraiya starts talking about their time together but just then Pain arrives. He reveals his ideology and the plans of the Akatsuki because Jiraiya was destined to die by his hands anyway.
Pain summons a chameleon to attack Jiraiya, in defense Jiraiya summons Gamakem and they engage in battle. Pain summons multiple creatures like the nine-headed dogs to attack Jiraiya. At this point in the Jiraiya realized that he was up against a powerful enemy and creates a barrier between him and Pain to decide his next strategy.
Jiraiya decides to enter Sage mode and summons Fukasaku and Shima to aid him in the battle. He finds Pain, who by that time had called upon two of his other-selves. Jiraiya, Fukasaku, and Shima start to battle the various Pains and manage to blind one of them.
While battling them Jiraiya realized that each of the Pain's bodies had its specific purpose. The trio then stalled for a bit of time and used genjutsu to defeat the other bodies of Pain.
While the battle was going on Jiraiya started having a flashback, to when he first met the Toad Sage who predicted that Jiraiya would travel the world and would train the Child of Prophecy. As Pain attacked Jiraiya severing his arm, he realized that it resembled one of the Ninjas he once had met, he also realized that Pain look like his late student, Yahiko. Jiraiya suddenly put two and two together and discovered the truth.
Before Jiraiya could leave, his throat was crushed by one Pain and then he was stabbed with poles by the other six Pains and pinned to the ground. It meant that he was unable to tell Fukasaku the information that he had learned. He then had another flashback in which he was talking to Minato and Kushina, when they informed him that they would want to name their unborn child Naruto, after the protagonist of Jiraiya's book.
After remembering this Jiraiya forced himself up and with the remaining willpower that he had left, he writes a message on Fukasaku's back. He then decided that Naruto was the Child of Prophecy. Pain shot his fist at Jiraiya on the concrete that he was lying on with Fukasaku escaping in the nick of time.
Jiraiya then sank to his death at the bottom of the lake in the village and Pain oversaw all this, declaring that Jiraiya had died. Even though Jiraiya was unsuccessful in killing Pain, he was able to send the information he had gathered about Pain and the Akatsuki back to Konoha to Tsunade!
A. Shuma Hiroyuki is his real name, later on, he was known as Jiraiya
A. Nagato could revive Jiraiya because he didn’t die during the battle at the Leaf Village and instead was killed by Pain in Amegakure.
A. The kanji on Jiraiya’s headband stands for ‘oil’ and it is a symbol for Myobokuzan.
A. Naruto and Nagato belong to the same clan that is the Uzumaki clan. They are also sibling disciples as they shared the same master in Jiraiya.
A. Nagato got the rinnegan from Obito Uchiha who implanted Madara Uchiha’s Rinnegan’s into him.