After slaying the Nemean lion, Eurystheus sent Hercules to slay the Hydra, which Hera had raised just to slay Hercules.
Upon reaching the swamp near Lake Lerna, where the Hydra dwelt, Hercules covered his mouth and nose with a cloth to protect himself from the poisonous fumes. He fired flaming arrows into the Hydra’s lair, the spring of Amymone, a deep cave that it only came out of to terrorize neighboring villages. He then confronted the Hydra, wielding a harvesting sickle (according to some early vase-paintings), a sword or his famed club. Ruck and Staples (1994: 170) have pointed out that the chthonic creature’s reaction was botanical: upon cutting off each of its heads he found that two grew back, an expression of the hopelessness of such a struggle for any but the hero. The weakness of the Hydra was that only one of its heads was immortal.
The details of the struggle are explicit in the Bibliotheca (2.5.2): realizing that he could not defeat the Hydra in this way, Hercules called on his nephew Iolaus for help. His nephew then came upon the idea (possibly inspired by Athena) of using a firebrand to scorch the neck stumps after each decapitation. Hercules cut off each head and Iolaus cauterized the open stumps. Seeing that Hercules was winning the struggle, Hera sent a large crab to distract him. He crushed it under his mighty foot. The Hydra’s one immortal head was cut off with a golden sword given to him by Athena. Hercules placed it under a great rock on the sacred way between Lerna and Elaius (Kerenyi 1959:144), and dipped his arrows in the Hydra’s poisonous blood, and so his second task was complete. The alternative version of this myth is that after cutting off one head he then dipped his sword in it and used its venom to burn each head so it couldn’t grow back. Hera, upset that Hercules slew the beast she raised to kill him, placed it in the dark blue vault of the sky as the Constellation Hydra. She then turned the crab into the Constellation Cancer.
Hercules later used an arrow dipped in the Hydra’s poisonous blood to kill the centaur Nessus; and Nessus’s tainted blood was applied to the Tunic of Nessus, by which the centaur had his posthumous revenge. Both Strabo and Pausanias report that the stench of the river Anigrus in Elis, making all the fish of the river inedible, was reputed to be due to the Hydra’s poison, washed from the arrows Heracles used on the centaur.