Francis Scott Key went to Baltimore to save his friend, but instead got captured. After being imprisoned for a while he noticed the sound of fighting had stopped so he looked outside and our flag was still standing. I think this was during the war of 1812