Key was a temporary prisoner of war during the attack, his mission to secure an exchange of prisoners suspended while British ships poured round after round into the fort's defenses, on September 13, 1814. It was a rainy night, and so the fort was flying its "storm flag," a smaller version of the normal 15-star-15-stripe flag. Key pinned his hopes for knowing whether the fort had been saved on whether the larger flag would be flying in the morning.
At dawn, on September 14, Key saw the normal flag in place. The defenses had held. The British had failed to capture Fort McHenry. This was a particularly key development since just 10 days earlier, British troops had burned Washington, D.C.
Key was moved to write a poem, which he titled "Defence of Fort M'Henry." (Lyrics are at the bottom of the page.) One source says that Key wrote the poem on the back of a letter he had in his pocket.
Key based his poem, some sources say, on an earlier song he wrote titled "When the Warrior Returns," in honor of soldiers returning from the First Barbary War, in 1805.
This earlier poem was set to music, to the tune of "The Anacreontic Song," a British tune written by John Stafford Smith that was already popular in the U.S. The song was also the official song of the Anacreontic Society, a group of amateur musicians in London.
Key's new lyrics, "Defence of Fort M'Henry," were set to that same tune. The poem had four stanzas in all. (Today, only the first stanza is sung, many say because of the difficulty in singing the wide range of notes found in the tune.)
Two newspapers printed the song and lyrics on September 20, 1814. Not long after, Baltimore's Carr Music Store published the words and music under a new title, "The Star Spangled Banner." Well-known author Washington Irving published the words and music in his magazine The Analectic, in November.
The song gained in popularity throughout the rest of the 19th Century (being played at military and public events, most notably July 4th celebrations), although various versions existed. President Woodrow Wilson called for an official version. Among the musicians on the committee to declare the official version was noted composer and bandleader John Philip Sousa. The official version premiered at Carnegie Hall on December 5, 1917. The anthem was first played at a baseball game, some sources say, during the Seventh Inning Stretch of the 1918 World Series.
It wasn't until 1931 that "The Star-Spangled Banner" became America's national anthem. Spurred by the popular cartoonist Robert Ripley's plea in his syndicated cartoon Ripley's Believe It Or Not! that "Believe It or Not, American has no national anthem," first Sousa and then Congress swung into action, suggesting that (in Sousa's case) and approving (in Congress's case) the song as the nation's official anthem. President Herbert Hoover signed the requisite bill into law on March 3, 1931.
As for the flag that inspired the poem and song and anthem, it was in tatters after the battle. It, and the smaller "storm flag," were sewn by Mary Pickersgill, as one of many such ship and signal flags. She and her daughter and two nieces spent seven weeks making the flags. The flag that inspired the anthem passed into the Armistead family and then to New York stockbroker Eben Appleton, who donated the flag to the Smithsonian Institution in 1912. The Smithsonian put the flag through an extensive conservation process in the 1990s. The restored flag is now in display in the Smithsonian.
The Star-Spangled Banner
O say can you see by the dawn's early light,
What so proudly we hailed at the twilight's last gleaming,
Whose broad stripes and bright stars through the perilous fight,
O'er the ramparts we watched, were so gallantly streaming?
And the rockets' red glare, the bombs bursting in air,
Gave proof through the night that our flag was still there;
O say does that star-spangled banner yet wave,
O'er the land of the free and the home of the brave?
On the shore dimly seen through the mists of the deep,
Where the foe's haughty host in dread silence reposes,
What is that which the breeze, o'er the towering steep,
As it fitfully blows, half conceals, half discloses?
Now it catches the gleam of the morning's first beam,
In full glory reflected now shines in the stream:
'Tis the star-spangled banner, O! long may it wave
O'er the land of the free and the home of the brave.
And where is that band who so vauntingly swore
That the havoc of war and the battle's confusion,
A home and a country, should leave us no more?
Their blood has washed out their foul footsteps' pollution.
No refuge could save the hireling and slave
From the terror of flight, or the gloom of the grave:
And the star-spangled banner in triumph doth wave,
O'er the land of the free and the home of the brave.
O thus be it ever, when freemen shall stand
Between their loved home and the war's desolation.
Blest with vict'ry and peace, may the Heav'n rescued land
Praise the Power that hath made and preserved us a nation!
Then conquer we must, when our cause it is just,
And this be our motto: "In God is our trust."
And the star-spangled banner in triumph shall wave
O'er the land of the free and the home of the brave!