The exact time of composition is unknown, but Nielsen most likely worked on it in the years before the publication of Op. 4, when he according to various sources was engaged with setting music to texts by J.P. Jacobsen. See more about this work at The Royal Library