The multi-headed serpent that grew two heads for each one cut off was the Hydra, specifically the Lernaean Hydra.
The Lernaean Hydra lived near Lake Lerna in the Argolid and was counted as the second labor of Heracles. Ancient accounts differ about its exact number of heads: some describe six, nine, or fifty, while others leave the total unspecified. Later versions emphasize its regenerative power, saying that two heads grew back whenever one was severed.
Heracles discovered that ordinary sword blows could not defeat the monster. With help from his nephew Iolaus, he burned or cauterized each neck stump after cutting off a head, preventing regeneration. The Hydra also had a supposedly immortal head, which Heracles buried beneath a massive rock. He later dipped arrows in the creature’s poisonous blood.
The Hydra is often confused with Typhon, Scylla, or the Chimera, but those monsters have different myths and forms. In astronomy, Hydra is also the name of a large constellation, although the celestial figure is connected to the mythological serpent through later tradition.