The legend according to the Brothers Grimm
In 1284 a strange man was seen around Hamelin. He wore a multi-coloured gown and claimed he was a rat catcher, in that he promised to rid the town of all its mice and rats for a specific sum of money.
The townsmen agreed to pay him what he asked and the rat catcher took out his flute and played. Immediately all the rats and mice crept out of every building and gathered around him. When he thought there were no more left, he walked out of the town, with the pack of rodents following him, to the River Weser, where the rats fell into the water and drowned.
As soon as the citizens realised they were free of their plague, they regretted what they had promised to pay the piper and refused to pay him, so that he went away embittered. On June 26th, though, he returned in the guise of a hunter, with a terrifying appearance, and wearing a strange, red hat. He played his flute as he passed through the streets whilst everyone was gathered in church, and was immediately surrounded not by rats and mice, but by a large number of children, boys and girls from the age of four. Playing all the time, he led them through the Ostertor (Eastern Gate) to a hillside, where he disappeared with them. Only two children returned because they had not been able to keep up – but one of them was blind, so the child could not point out the place, and the other was dumb, so the child could not tell anyone where the place was. One little boy turned back to get his coat and so escaped the tragedy. Some said the children were enticed into a cave and emerged again in Transylvania. A total of 130 children were lost. (As told in "German Legends" by the Brothers Grimm)