First published in "Little Children's Book for Schools and Families" (1885), edited by James Murray, set to the tune "St. Kilda" by J. E. Clark. Unfortunately, no further information is available about "St. Kilda" and its author.
Some time later Murray wrote another tune for the lyrics, which is usually given the name "Mueller". This tune+lyrics combination first appeared in the book "Dainty Songs for Little Lads and Lasses", with the note: "Composed by Martin Luther for his children, and still sung by German mothers to their little ones." Of course, the attribution is unfounded; it is rather likely that the lyrics were written in 1883 to celebrate Luther's 400th birthday.