The national anthem of the United States is The Star-Spangled Banner. It was written in 1814 by Francis Scott Key, a 35-year-old lawyer and amateur poet, after he witnessed the bombardment of Fort McHenry by British ships in Chesapeake Bay during the Battle of Baltimore in the War of 1812. Key was inspired by the large U.S. flag—known as the Star-Spangled Banner—flying triumphantly above the fort after the American victory. He wrote a poem titled "Defence of Fort M'Henry," which was later set to music and officially became the national anthem in 1931.