Hanzo was the leader of the Rain village whom fought Jiraiya, Orochimaru, and Tsunade in their youth and is the one that dubbed them the "Sannin." He was infamous and revered in all ninja villages.
The Rain village is located in a poverty-stricken country that, due to it's location, had been the battleground for warring ninja villages. Because of this the village is filled with refugees and orphans. The Rain village is also very secretive, all travelers must state their business and are watched continuously until they leave.
Roughly 30 years ago he encountered Jiraiya, Orochimaru, and Tsunade during the second great ninja war. He knew that the Leaf village would win the war and killing them would mean nothing, so he decided to let them leave. He acknowledged their incredible talents and said that he would honor them as the Leaf village's "Sannin."
Many years later, during the prolonged war between the Leaf, Sand, and Rock villages taking place in the Rain village, an organization sprung up within the Rain village that grew rapidly and battled against all sides. Hanzo came to the organization's leader, Yahiko, saying that he can use them to form treaties with the warring villages.
When Yahiko and Nagato showed up to the assigned meeting place, they found Hanzo along with Danzo of the Leaf village's Root and that they came to an arrangement; Hanzo would help Danzo become Hokage, and Danzo would help solidify Hanzo's leadership of the Rain village, and getting rid of Yahiko's was the only way to accomplish this. Yahiko and Nagato found that Hanzo had their companion, Konan, hostage and threatened her life if Nagato didn't kill Yahiko.
In order to save his friends, Yahiko committed suicide. After this, Hanzo ordered his soldiers to kill Nagato aswell. They threw kunais, but Nagato repelled them with Shinra Tensei and leaped after Konan, Hanzo backed away and revealed his trap, Nagato's legs were covered in paper bombs but Nagato remained standing after the blast, despite his legs in horrible shape.
Nagato then summoned the Heretical Demon Statue, at which point spikes extended from it and pierced Nagato's back which withered him. An energy in the shape of a dragon came from the statue's mouth and instantly removed the soul from anyone it came in contact with. Enraged and forever changed, Nagato sent tried to attack Hanzo, however Hanzo used a teleportation jutsu and was able to escape at the last moment.
Many years after this, a civil war broke out in the Rain village between Pain and Hanzo, with the existing ninjas in the village choosing sides. The elderly Hanzo was guarded 24/7 by some of the village's most elite ninja, but was eventually killed by Pain. Pain then killed Hanzo's family and everyone Hanzo ever associated with. Those still loyal to Hanzo have attempted multiple times to assassinate Pain, though they have not been successful.
Hanzo is revived by Kabuto's Impure World Resurrection jutsu to fight alongside the Akatsuki against the Allied Shinobi forces. He encounters and fights the samurai Mifune, who he had fought decades beforehand, and defeated. After a drawn out battle, where Mifune and Hanzo earn each other's respect, he exposes his weakness, his poison sac. The sac is then ruptured, causing him to become paralyzed, and this allowing his body to be sealed by Mifune's team.
Though Hanzo is mostly a mystery, it is known that he could summon giant salamanders which aided him in battle. He also wore a special breathing apparatus that allowed him to survive underwater, where his speed is said to be unsurpassed. It's also believed that no single individual can defeat him.