The words of Once in Royal David's City were written by Cecil Frances Alexander and published in her 1848 hymnbook. The tune was composed by organist Henry John Gauntlett.