On September 3, 1814, Francis Scott Key and John Stuart Skinner set sail from Baltimore aboard the ship HMS Minden, flying a flag of truce on a mission approved by President James Madison. Their objective was to secure the exchange of prisoners, one of whom was Dr. William Beanes, the elderly and popular town physician of Upper Marlboro and a friend of Key’s who had been captured in his home. Beanes was accused of aiding the arrest of British soldiers. Key and Skinner boarded the British flagship HMS Tonnant on September 7 and spoke with Major General Robert Ross and Vice Admiral Alexander Cochrane over dinner while the two officers discussed war plans. At first, Ross and Cochrane refused to release Beanes, but relented after Key and Skinner showed them letters written by wounded British prisoners praising Beanes and other Americans for their kind treatment.
Because Key and Skinner had heard details of the plans for the attack on Baltimore, they were held captive until after the battle, first aboard HMS Surprise and later back on HMS Minden. After the bombardment, certain British gunboats attempted to slip past the fort and effect a landing in a cove to the west of it, but they were turned away by fire from nearby Fort Covington, the city's last line of defense.
During the rainy night, Key had witnessed the bombardment and observed that the fort’s smaller "storm flag" continued to fly, but once the shell and Congreve rocket[5] barrage had stopped, he would not know how the battle had turned out until dawn. By then, the storm flag had been lowered and the larger flag had been raised.
During the bombardment, HMS Erebus provided the "rockets red glare". HMS Meteor provided at least some of the "bombs bursting in air".
Key was inspired by the American victory and the sight of the large American flag flying triumphantly above the fort. This flag, with fifteen stars and fifteen stripes, came to be known as the Star Spangled Banner Flag and is today on display in the National Museum of American History, a treasure of the Smithsonian Institution. It was restored in 1914 by Amelia Fowler, and again in 1998 as part of an ongoing conservation program.
Aboard the ship the next day, Key wrote a poem on the back of a letter he had kept in his pocket. At twilight on September 16, he and Skinner were released in Baltimore. He completed the poem at the Indian Queen Hotel, where he was staying, and entitled it "Defence of Fort McHenry."
Much of the idea of the poem and even some of the wording is arguably derived from an earlier song by Key, also set to the tune of The Anacreontic Song. The song, known as "When the Warrior Returns,"[6] is said to have been written in honor of Stephen Decatur and Charles Stewart on their return from the First Barbary War.
According to the historian Robin Blackburn, the words "the hireling and slave" allude to the fact that the British attackers had many ex-slaves in their ranks, who had been promised liberty and demanded to be placed in the battle line "where they might expect to meet their former masters."[7]
Key gave the poem to his brother-in-law, Judge Joseph H. Nicholson. Nicholson saw that the words fit the popular melody "The Anacreontic Song", of English composer John Stafford Smith, which was the official song of the Anacreontic Society, an 18th-century gentlemen's club of amateur musicians in London. Nicholson took the poem to a printer in Baltimore, who anonymously printed broadside copies of it—the song’s first known printing—on September 17; of these, two known copies survive.
On September 20, both the Baltimore Patriot and The American printed the song, with the note "Tune: Anacreon in Heaven." The song quickly became popular, with seventeen newspapers from Georgia to New Hampshire printing it. Soon after, Thomas Carr of the Carr Music Store in Baltimore published the words and music together under the title "The Star-Spangled Banner," although it was originally called "Defence of Fort McHenry." The song’s popularity increased, and its first public performance took place in October, when Baltimore actor Ferdinand Durang sang it at Captain McCauley’s tavern. Washington Irving, then editor of The Analectic Magazine in Philadelphia, reprinted the song in November 1814.
The song gained popularity throughout the nineteenth century and bands played it during public events, such as July 4 celebrations. On July 27, 1889, Secretary of the Navy Benjamin F. Tracy signed General Order #374, making "The Star-Spangled Banner" the official tune to be played at the raising of the flag.
In 1916, President Woodrow Wilson ordered that "The Star-Spangled Banner" be played at military and other appropriate occasions. Although the playing of the song two years later during the seventh-inning stretch of the 1918 World Series is often noted as the first instance that the anthem was played at a baseball game, evidence shows that the "Star-Spangled Banner" was performed as early as 1897 at opening day ceremonies in Philadelphia and then more regularly at the Polo Grounds in New York City beginning in 1898. However, the tradition of performing the national anthem before every baseball game began in World War II.[8] Today, the anthem is performed before the beginning of all MLS, NBA, NFL, MLB and NHL games (with at least one American team playing), as well as in a pre-race ceremony portion of every NASCAR race.
On November 3, 1929, Robert Ripley drew a panel in his syndicated cartoon, Ripley's Believe it or Not!, saying "Believe It or Not, America has no national anthem".[9] In 1931, John Philip Sousa published his opinion in favor, stating that "it is the spirit of the music that inspires" as much as it is Key’s "soul-stirring" words. By a law signed on March 3, 1931 by President Herbert Hoover, "The Star-Spangled Banner" was adopted as the official national anthem of the United States.