It was written by Francis Scott Key, when he was watching the British bombarding Fort McHenry.