Oscar Ahnfelt (1813–1882) was a Swedish singer, composer and music publisher
The spiritual troubadour of Sweden Ahnfelt composed the music for many of Lina Sandell's hymns. He was a pietist, who traveled all over Scandinavia, playing his 10-string guitar and singing her lyrics. The state church authorities did not like pietistic hymns and, anticipating a royal injunction against the singing of Sandell's songs, ordered Ahnfelt to sing them before King Karl XV. But after hearing them, the King announced to Ahnfelt, "You may sing as much as you desire in both of my kingdoms."  Ahnfelt sang them so much that Sandell wrote, "Ahnfelt has sung my songs into the hearts of the people."
Sandell - Ahnfelt hymns have spread throughout the world. Two of the best-known ones in English are Children of the Heavenly Father (Tryggare kan ingen vara) and Day by day (Blott en dag).
Jenny Lind, known worldwide as the "Swedish Nightingale", was also a pietist and popularized Sandell's hymns in America and wherever she sang. She additionally helped finance Ahnfelt's Andeliga Sånger (Sacred Songs), first published in 1850.
Ahnfelt died October 22, 1882 in Karlshamn, Blekinge. He is buried in Hvilans Kyrkogård (Hvilans Cemetery) in Karlshamn.