The Pied Piper of Hamelin is the titular character of a legend from the town of Hamelin, Lower Saxony, Germany. The legend dates back to the Middle Ages, the earliest references describing a piper, dressed in multicolored clothing, who was a rat-catcher hired by the town to lure rats away with his magic pipe.