"Gud, som haver barnen kär..." (Swedish: "God, who holds the children dear") is an old prayer for children, of unknown origin. The prayer was first printed in 1780 in "Barnabok, hans Kongl. höghet kronprinsen i underdånighet tilägnad af Samfundet Pro fide et Christianismo" ("Children's book, humbly dedicated to his Royal Highness the Crown Prince by the Society Pro fide et Christianismo"), which was published on the occasion of the Swedish crown prince's (later Gustav IV Adolf) second birthday. In the book the prayer is called "En allmän bön för små barn" ("A general prayer for little children") and reads as follows:
"Gud som haver barnen kär
Se till mig som liten är
Vart jag mig i världen vänder
Står min lycka i Guds händer
Lyckan kommer lyckan går
Den Gud älskar lyckan får
"God! who loves the children dear,
Look after me, little one
Wherever in the world I wander
My happiness is in gods hands
Happiness comes happiness goes
He who loves god gets happiness"
It is likely based on an orally transmitted prayer. It was first printed as a hymn in the Salvation Army songbook of 1907. It was later published in the Swedish Sunday School songbook (1908) where three additional verses were composted by Johan Bernhard Gauffin and Carl Boberg and eventually in the "normal hymn book Nya psalmer 1921, the annex to Swedish hymnal of 1819 where Siri Dahlquist extended the prayer with five additional verses, of which the first one begins "Gode Fader, i din vård" ("Good father, in thy care").
The melody, according to Koralbok för Nya psalmer, 1921 was possibly composed in 1531, but in later editions the melody is attributed to Ivar Widéen in 1912. The prayer is also sometimes sung with the same melody as "Twinkle, twinkle, little star". The first printed version of the prayer was sung to the melody "Härlig är Guds himmel blå".