“The Star-Spangled Banner” became the official U.S. national anthem on March 3, 1931.
The song’s lyrics came from “Defence of Fort M’Henry,” a poem written by Francis Scott Key after he witnessed the British bombardment of Fort McHenry during the Battle of Baltimore in the War of 1812. Key saw the large American flag still flying over the fort after the battle.
The poem was later set to the melody of “The Anacreontic Song,” written by English composer John Stafford Smith. The resulting song became popular in the United States during the nineteenth century, although it was not yet the nation’s official anthem.
Congress passed legislation making it the national anthem in 1931, and President Herbert Hoover signed it. The official song has four stanzas, but public performances usually use only the first. Before 1931, “Hail, Columbia” and “My Country, ’Tis of Thee” served as de facto patriotic anthems.