From the History Channel website:
The anthem’s history began the morning of September 14, 1814, when an attorney and amateur poet named Francis Scott Key watched U.S. soldiers—who were under bombardment from British naval forces during the War of 1812—raise a large American flag over Fort McHenry in Baltimore, Maryland.