"Christmas Bells" is both an occasional poem written during the Civil War, and a general message about having hope during times of despair. Longfellow wrote it on December 25th, 1863; it was published in a juvenile magazine in 1865 and included in the collection Flower-de-luce (1866). The melancholy tone of much of the poem makes sense given the fact that Fanny, Longfellow's second wife, had died in an accidental fire two years prior, and his son Charles had been grievously wounded in the war about a month before the poem's conception.
The poem is perhaps best known as a Christmas carol, however. In 1872, the poem was set to music (with two stanzas elided); Jean Baptiste Calkin, an English organist, was the most prominent early adapter of the poem, using it in a processional set to a melody he'd worked on in the late 1840s. Famous recordings set to different music by Johnny Marks include those by Harry Belafonte, Bing Crosby, Frank Sinatra, and Bette Midler.
It is often anthologized as it is considered one of the poet's most famous works.