<P> The Star - Spangled Banner , or the Great Garrison Flag , was the garrison flag that flew over Fort McHenry in Baltimore Harbor during the naval portion of the Battle of Baltimore during the War of 1812 . Seeing the flag during the battle inspired Francis Scott Key to write the poem `` Defence of Fort M'Henry '' , which , retitled with the flag 's name from the closing lines of the first stanza and set to the tune of `` To Anacreon in Heaven '' by John Stafford Smith , later became the national anthem of the United States . </P>
the battle that inspired the star spangled banner
the Battle of Baltimore during the War of 1812