The tune, Zahn No. 4947, first appears in Codex 1305, a manuscript in Leipzig University Library dating from c. 1400, although it has been suggested that the melody may have existed in Europe prior to this date. In print, the tune was included in "Geistliche Lieder", a 1533 Lutheran hymnal by Joseph Klug. It also appears in Michael Vehe's "Gesangbuch" of 1537. In 1545, another verse was added, possibly by Martin Luther. This was included in Valentin Babst's "Geistliche Lieder", printed in Leipzig. The melody was also popular elsewhere in Europe, and appears in a Swedish/Latin version in the 1582 Finnish songbook "Piae Cantiones", a collection of sacred and secular medieval songs.