The earliest known reference to the leprechaun appears in the medieval tale known as the Echtra Fergus mac Léti (Adventure of Fergus son of Léti). The text contains an episode in which Fergus mac Léti, King of Ulster, falls asleep on the beach and wakes to find himself being dragged into the sea by three lúchorpáin. He captures his abductors, who grant him three wishes in exchange for release.
The leprechaun is said to be a solitary creature, whose principal occupation is making and mending shoes, and who enjoys practical jokes. According to William Butler Yeats, the great wealth of these fairies comes from the “treasure-crocks, buried of old in war-time”, which they have uncovered and appropriated.
The appearance of a leprechaun varies with the eras. The modern day Leprechaun is described as sitting on a toadstool, with red beard, wearing a green hat and green garments.
Some folk traditions hold that the leprechauns are descended from the Tuatha de Danann. When the Milesians came to Ireland (according to the Book of Invasions) they conquered the Tuatha de Danann and forced them to live under ground (this connects them to the aes-sidhe).