The traditional U.S. Marines' hymn contains lyrics that were featured in "Rhymes of the Rookies," a songbook that was published in 1917. W.E. Christian wrote the poems and songs found in the book. This song is the oldest official song still played by the U.S. Armed Forces, and it was introduced into the U.S. Marine Corps by Francesco Maria Scala. The hymn is typically sung as a gesture of respect or from a position of attention.
While the "Rhymes of the Rookies" book contained the first recorded instance of the song, some of the lyrics were popular before the hymn was penned down. The lyric "to the shores of Tripoli" is a reference to the Battle of Derne in 1805. The lyric "the halls of Montezuma" is a reference to the Battle of Chapultepec during the Mexican-American War. The exact author of the lyrics is unknown, and many believe that the song was written by a Marine in Mexico.
The music that accompanies the lyrics originated from the "Gendarmes' Duet," which is a revision of the Genevieve de Brabant opera in 1867. Over the years, different people added additional lyrics and verses to the song to commemorate later actions and battles.