America declared war on the Barbary Pirates of northern Africa in 1805 because they had been raiding our ships in the Mediterranean Sea. During the conflict, Lieutenant Presley N. O’Bannon, United States Marine Corps, and his small force of Marines participated in the capture of the city of Derne in Tripoli (which is today part of the country of Libya). As this was the first time that the American flag had been hoisted over a fortress in the Old World, the Colors (ceremonial flag) of the Marine Corps were inscribed with the words: “To the Shores of Tripoli.”
During the hardest fighting of the Mexican War; U.S. Marines were the first to breach the otherwise impregnable walls of Mexico City by capturing the Castle of Chapultapec, which was the palace of the great Aztec emperor, Montezuma. The Colors of the Corps were then changed to read “From the Shores of Tripoli to the Halls of Montezuma.” Following the close of the Mexican War came the first great verse of the Marines’ Hymn, written according to tradition by a Marine on duty in Mexico. For the sake of the euphony, the unknown author transposed the phrases in the motto on the Colors so that the first two lines of the Hymn would read: “From the Halls of Montezuma to the Shores of Tripoli.”
Many interesting stories have been associated with the Marines’ Hymn. One of the best was published in the Stars and Stripes, the official newspaper of the American Expeditionary Force in Europe, under the date of August 16, 1918. “A wounded officer from among the gallant French Lancers had just been carried into a Yankee field hospital to have his dressing changed. He was full of compliments and curiosity about the dashing contingent that fought at his regiment’s left. ‘A lot of them are mounted troops by this time,’ he explained, ‘for when our men would be shot from their horses, these youngsters would give one running jump and gallop ahead of cavalry. I believe they are soldiers from Montezuma. At least, when they advanced this morning, they were all singing ‘From the Halls of Montezuma to the Shores of Tripoli.’
The Marines’ Hymn has been sung and played in all four corners of the earth and today is recognized as one of the foremost service songs.