On route home after a night's drinking, Jack encounters the Devil and tricks him into climbing a tree. A quick-thinking Jack etches the sign of the cross into the bark, thus trapping the Devil. Jack strikes a bargain that Satan can never claim his soul. After a life of sin, drink, and mendacity, Jack is refused entry to heaven when he dies. Keeping his promise, the Devil refuses to let Jack into hell and throws a live coal straight from the fires of hell at him. It was a cold night, so Jack places the coal in a hollowed out turnip to stop it from going out, since which time Jack and his lantern have been roaming looking for a place to rest.
The practice may have originated in a Celtic festival, held on 31 October–1 November, to mark the beginning of winter. It was called Samhain in Ireland, Scotland and the Isle of Man, and Calan Gaeaf in Wales, Cornwall and Brittany. The festival is believed to have pre-Christian roots. After the Christianization of Ireland in the 5th century, some of these customs may have been retained in the Christian observance of All Hallows' Eve in that region—which continued to be called Samhain/Calan Gaeaf—blending the traditions of their ancestors with Christian ones. It was seen as a liminal time, when the spirits or fairies (the Aos Sí), and the souls of the dead, could more easily come into our world. It was believed that the Aos Sí needed to be propitiated to ensure that the people and their livestock survived the winter.