Whitman wrote the poem in 1871 and published it in the "President Lincoln's Burial Hymn" cluster of
Passage to India, a poetry collection intended as a supplement to
Leaves of Grass. It was republished in the "Memories of President Lincoln" cluster, first in the 1871–1872 edition of
Leaves of Grass. It is the only poem in this cluster that did not first appear in the poetry collections
Drum-Taps or
Sequel to Drum-Taps. The poem was not revised after its first publication.