You’ve heard the anthem many times, but where did it come from? The history of the star spangled banner starts with Francis Scott Key’s 1814 poem about Fort McHenry; Congress made it the anthem in 1931.
This story is one of the patriotic stories on this site about the moments behind America’s national symbols.
| Item | Value |
|---|---|
| British bombardment of Fort McHenry begins | September 13, 1814 |
| Length of the bombardment | About 25 hours |
| Poem first published in the Baltimore Patriot | September 20, 1814 |
| Original title of the poem | “Defence of Fort M’Henry” |
| Woodrow Wilson adopts it as a de facto anthem | 1916 |
| Adopted as the national anthem by law | March 3, 1931 |
These dates come from the American Battlefield Trust and HISTORY. Sources are updated and can differ on small details, so check the source before you rely on the figures.
Why was Fort McHenry under attack?
According to HISTORY, America declared war on Great Britain on June 18, 1812, after a series of trade disagreements. In August 1814, British troops invaded Washington, D.C., and burned the White House, Capitol Building and Library of Congress. Baltimore was next.
The American Battlefield Trust explains that Fort McHenry was one of the last lines of defense for Baltimore: if the fort was captured, then Baltimore would be as well. Francis Scott Key was nearby for a different reason entirely. He was trying to free a friend.
Dr. William Beanes, a doctor and colleague of Key, had refused to give food and drink to British soldiers at his house in Upper Marlboro, Maryland, and was scheduled to be hanged. Key and prisoner exchange agent John Stuart Skinner negotiated his freedom. But because they had seen the British fleet’s positions and plans, the three men could not return to shore.
The key dates came quickly:
- September 5: Key and Skinner sail into the harbor to meet Admiral George Cockburn about Beanes’s release.
- September 12: the British land their forces at North Point to attempt a land attack on Baltimore.
- September 13: at sunrise, British naval ships begin firing on Fort McHenry.
The night that inspired the star spangled banner
As the bombardment began at sunrise on September 13, 1814, Vice Admiral Alexander Cochrane gave the order to fire, as the American Battlefield Trust recounts. HISTORY notes that U.S. soldiers at the fort withstood some 25 hours of it.
Key watched from aboard a ship located about eight miles away, per HISTORY. He could only guess at the fort’s fate through the night. At daybreak he was inspired by the sight of a lone U.S. flag still flying over Fort McHenry.
That moment is captured in the lines “And the rocket’s red glare, the bombs bursting in air, Gave proof through the night that our flag was still there.” Key wrote the first verse on the back of a letter while watching the large flag wave that morning, as HISTORY describes it.

From poem to song: a borrowed melody
Back in Baltimore, Key kept working until he had completed four verses, though only one is commonly known today. A local printer issued the work as “Defence of Fort M’Henry,” and two Baltimore newspapers printed it, according to HISTORY. The American Battlefield Trust adds that the Baltimore Patriot published it on September 20, 1814.
Accounts differ on who matched words to music. The Trust says Key’s brother-in-law set the poem to music, while HISTORY says Key assigned the melody. Either way, the tune was an English favorite:
- It was called “To Anacreon in Heaven,” by composer John Stafford Smith.
- It was written around 1775 and honored the ancient Greek poet Anacreon, a lover of wine.
- It was first performed at a London gentleman’s music club called the Anacreontic Society.
- Americans already knew it: defenders of President John Adams used it for “Adams and Liberty.”
- Key had used it himself in 1805 for verses honoring American naval victories in the Barbary War.
By November 1814, the composition had appeared in print under the name “The Star-Spangled Banner.” It spread quickly to cities along the East Coast.
How the song became the national anthem
The song was not an instant anthem. HISTORY reports that it first trailed “Yankee Doodle” and “Hail Columbia” in popularity. During and right after the Civil War, it gained deeper meaning as the flag became a powerful symbol of national unity.
The path to official status ran through several steps, according to the American Battlefield Trust and HISTORY:
- By the 1890s: the U.S. military was playing it for ceremonies, to accompany the raising and lowering of the colors.
- 1916: President Woodrow Wilson adopted it as a de facto “national anthem” but did not codify the ruling.
- 1929: despite many objections, House Resolution 14 was presented to Congress to name it the official anthem.
- March 3, 1931: it was officially adopted by law.
As of the March 3, 1931 law, then, the national anthem has had a clear legal footing. If you enjoy how national symbols took shape, the history of the pledge of allegiance is another story worth reading. For practical guidance on the flag that inspired Key, see this guide to american flag etiquette.
Key’s complicated legacy
After the war, Key kept a thriving law career. HISTORY says he served in President Andrew Jackson’s “Kitchen Cabinet,” was appointed U.S. attorney for the District of Columbia in 1833, and died in 1843 at the age of 63 after contracting pleurisy.
The same source is candid about the contradiction in his life. Though the anthem calls America “the land of the free,” Key was a slaveholder from an old Maryland plantation family, and as a U.S. attorney he argued several prominent cases against the abolitionist movement. He spoke out against the cruelties of slavery but did not see abolition as the solution, and he became a leader of the colonization movement, which advocated relocating black slaves to Africa.
Frequently asked questions
Who wrote the Star-Spangled Banner?
Show answer
Francis Scott Key, an attorney and amateur poet, wrote the words after watching the British bombardment of Fort McHenry, according to HISTORY.
What was the song originally called?
Show answer
The poem was titled “Defence of Fort M’Henry.” The American Battlefield Trust says the poem and music were later published together as “The Star-Spangled Banner.”
What tune does the anthem use?
Show answer
It uses “To Anacreon in Heaven,” a popular English drinking song by John Stafford Smith, as HISTORY notes.
When did it become the official national anthem?
Show answer
It was officially adopted by law on March 3, 1931, according to the American Battlefield Trust.
How many verses did Key write?
Show answer
Key completed four verses, and only one is commonly known today, per HISTORY.



