The tune is that of an old Welsh air, first found in a musical manuscript by Welsh harpist John Parry Ddall (c. 1710–1782), but undoubtedly much older than that. The composition is still popular as a dance tune in Wales, and was published in the 1784 and 1794 editions of the harpist Edward Jones's Musical and Poetical Relics of the Welsh Bards. Poet John Ceiriog Hughes wrote the first published lyrics for the piece in Welsh, titling it "Nos Galan" ("New Year's Eve"). A middle verse was later added by folk singers.
During the Victorian re-invention of Christmas it was turned into a traditional English Christmas song. The first English version appeared in The Franklin Square Song Collection, edited by J.P.McCaskey in 1881.