The lyrics come from `` Defence of Fort McHenry '' , a poem written in NUMBER@1 by the 35-year-old amateur poet PERSON@1 after witnessing the bombardment of PERSON@2 by ORGANIZATION@1 ships in LOCATION@1 during the Battle of LOCATION@2 in the War of NUMBER@2 .

PERSON@1 wrote the words to it in NUMBER@1 after seeing MISC@1 ships attacking Fort McHenry in LOCATION@2 , LOCATION@3 during the War of NUMBER@2 .
