The melody is probably from a French source. This metrical version likely dates from the 13th century. The Latin lyrics date to the time of Charlemagne (771 - 814). There is an English version from the time of Cynewulf (c. 800). The Latin was translated by J. M. Neale in 1851.
It is included in The New Oxford Book of Carols (#16).