The Pied Piper of Hamelin (German: Rattenfänger von Hameln, the Rat-Catcher of Hamelin) is the subject of a legend concerning the departure or death of a great number of children from the town of Hamelin (Hameln), Lower Saxony, Germany, in the Middle Ages.
The earliest references describe a piper, dressed in multicolored clothing, leading the children away from the town never to return.
In the 16th century the story was expanded into a full narrative, in which the piper is a rat-catcher hired by the town to lure rats away with his magic pipe.
When the citizenry refuses to pay for this service, he retaliates by turning his power that he put in his instrument on their children, leading them away as he had the rats.
This version of the story spread as folklore.
This version has also appeared in the writings of, amongst others, Johann Wolfgang von Goethe, the Brothers Grimm and Robert Browning.
In 1284, while the town of Hamelin was suffering from a rat infestation, a man dressed in pied clothing appeared, claiming to be a rat-catcher.
He promised the mayor a solution for their problem with the rats. The mayor in turn promised to pay him for the removal of the rats.
The man accepted, and played a musical pipe to lure the rats with a song into the Weser River, where all but one drowned.
Despite his success, the mayor reneged on his promise and refused to pay the rat-catcher the full amount of money.
The man left the town angrily, but vowed to return some time later, seeking revenge. On Saint John and Paul's day while the inhabitants were in church, he played his pipe yet again, dressed in green, like a hunter, this time attracting the children of Hamelin.
One hundred and thirty boys and girls followed him out of the town, where they were lured into a cave and never seen again. Depending on the version, at most three children remained behind.
One of the children was lame and could not follow quickly enough, the second was deaf and followed the other children out of curiosity, and the last was blind and unable to see where he was going.
These three informed the villagers of what had happened when they came out of church.
Another version relates that the Pied Piper led the children into following him to the top of Koppelberg Hill, where he took them to a beautiful land and had his wicked way, or a place called Koppenberg Mountain,or that he made them walk into the Weser river like he did with the rats and all the children drowned.
Some versions state that the Piper returned the children after payment, or that he returned the children after the villagers paid several times the original amount of gold.