"The Star Spangled Banner" was written by Francis Scott Key during the War of 1812. On the morning of Sept. 14, 1814, American soldiers at Fort McHenry raised a large American flag at reveille. The flag, with British cannonfire as a backdrop, inspired Key to write a poem.
Key's poem was entitled "The Defense of Fort McHenry" and contained what would become the lyrics of "The Star Spangled Banner." The poem was set to the melody of "To Anacreon in Heaven," written by English composer John Stafford Smith. The song gained popularity throughout the 19th century and was designated the national anthem of the United States on March 3, 1931.