In early September 1814, Francis Scott Key, an American lawyer and amateur poet, accompanied American Prisoner Exchange Agent Colonel John Stuart Skinner to negotiate a prisoner release with several officers of the British Navy. During the negotiations, Key and Skinner learned of the British intention to attack the city of Baltimore, as well as the strength and positions of British forces. They were not permitted to leave for the duration of the battle and witnessed the bombardment of Baltimore's Fort McHenry on September 13 and 14. Inspired by the American victory and the sight of the American flag flying high in the morning, Key wrote a poem titled "The Defence of Fort McHenry."

Key set the lyrics to the anthem of the London-based Anacreontic Society, "The Anacreontic Song." (Nine years earlier, Key had used the same tune for “When the Warrior Returns (from the Battle Afar)” to celebrate Stephen Decatur’s return from fighting the Barbary pirates, which included the line “By the light of the Star Spangled flag of our nation.”)

The poem was taken to a printer, who made broadside copies of it. A few days later, the Baltimore Patriot and The Baltimore American printed the poem with the note "Tune: Anacreon in Heaven." Later, Carrs Music Store in Baltimore published the words and music together as "The Star Spangled Banner."

The song gained popularity over the course of the 19th century and was often played at public events like parades and Independence Day celebrations (and, on occasion, sporting events). In 1889, the Secretary of the Navy ordered it the official tune to be played during the raising of the flag. In 1916, President Woodrow Wilson ordered that it be played at all military ceremonies and other appropriate occasions, making it something of an unofficial national anthem.

After America's entrance into World War I, Major League Baseball games often featured patriotic rituals, such as players marching in formation during pregame military drills and bands playing patriotic songs. During the seventh-inning stretch of Game One of the 1918 World Series, the band erupted into "The Star-Spangled Banner." The Cubs and Red Sox players faced the centerfield flag pole and stood at attention. The crowd, already on their feet, began to sing along and applauded at the end of the song.

Given the positive reaction, the band played the song during the next two games, and when the Series moved to Boston, the Red Sox owner brought in a band and had the song played before the start of each remaining contest. After the war (and after the song was made the national anthem in 1931), the song continued to be played at baseball games, but only on special occasions like opening day, national holidays, and World Series games.

During World War II, baseball games again became venues for large-scale displays of patriotism, and technological advances in public address systems allowed songs to be played without a band. "The Star-Spangled Banner" was played before games throughout the course of the war, and by the time the war was over, the pregame singing of the national anthem had become cemented as a baseball ritual, after which it spread to other sports.

Have you got a Big Question you'd like us to answer? If so, let us know by emailing us at bigquestions@mentalfloss.com.