It comes from Irish folklore. According to the tale, a man named Jack, who was notorious as a drunkard and trickster, tricked Satan into climbing a tree. Jack then carved an image of a cross in the tree's trunk, trapping the devil up the tree. Jack made a deal with the devil that, if he would never tempt him again, he would promise to let him down the tree. After his death, he was unable to enter heaven or hell, and was destined to roam the earth listlessly. Jack placed a piece of coal into a carved-out turnip and used it as a lantern to keep the evil spirits away. Later, the turnips were replaced with pumpkins.