"The Pied Piper of Hamelin", also known as "Rattenfänger von Hameln", is a German legend featured on ABC's Once Upon a Time.
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.
The musical pipe is enchanted so that only boys who feel unloved are capable of hearing and being drawn to the sound.
From the very beginning, the piper never helps the villagers of Hamelin and only intends to steal away boys as companions. These boys later become the Lost Boys from the "Peter Pan" story.