The words of this song were written by Julia Ward Howe, an author and abolitionist. She wrote it while visiting President Abraham Lincoln in Washington DC at the start of the Civil War in November 1861. She heard the soldiers singing the song with different, sillier words. Her words were meant give dignity and purpose to what she viewed to be a song worthy of a more serious subject. She had seen a skirmish between the Union and Confederate forces earlier that day and wrote the lyrics almost in one sitting in the early morning of the next day. Her lyrics were first published in 1862. They became inspiration for the Union troops and solace for the churchgoers at home who supported them. The anthem was Lincoln's favorite, and he frequently asked that it be performed in his presence.
After the war, the song continued to give purpose and meaning to the American people. It is an iconic anthem. John Steinbeck named his 1939 novel, The Grapes of Wrath, after a line from the first verse. Dr. Martin Luther King Jr. often quoted from the lyrics in his speeches, including the speech that he gave in Memphis the night before his assassination.