The Star-Spangled Banner was written by Francis Scott Key. He wrote the lyrics as a poem titled "Defence of Fort M'Henry" on September 14, 1814, after witnessing the British bombardment of Fort McHenry during the War of 1812. The poem was later set to the tune of a popular British song "To Anacreon in Heaven" and became the United States national anthem.