The song was written in 1917 and became a popular patriotic anthem during World War I. It was inspired by the American entry into the war and the need to boost morale and encourage young men to enlist.
The song's success helped solidify the importance of patriotic music during wartime and is still sung today, particularly at military events and celebrations of American patriotism.