This poem, which was originally named "The Defence of Fort M'Henry", was written by Key after he witnessed a fort in Maryland get bombarded by the British government.
On September 14, 1914, Francis Scott Key wrote a poem that was later set to music. In 1931, this poem ended up becoming the national anthem, titled The Star-Spangled Banner.
Key was inspired to write this song when he saw one lone U.S. flag flying over Fort McHenry at daybreak after a night of bombings. Evidently, this visual was so powerful that Key couldn't stop himself from writing about its beauty.
“And the rocket’s red glare, the bombs bursting in air, Gave proof through the night that our flag was still there.” This was a reflective statement about the moment he caught this visual.
Evidently, Francis Scott Key wouldn't have been in the position he was in if it weren't for the depraved actions of the British.
Key was escaping Baltimore since the British troops had just finished burning down the White House, Capitol Building, and Library of Congress in Washington D.C. The British army was making a beeline for the port of Maryland, so Key was scrambling to put his things and people together to escape.
Key's dear friend, Dr. William Beanes, was taken prisoner by British troops that arrived before the army did. The British took his friend onto a boat in Baltimore while Key chased them and negotiated Beanes' release. It was there where Francis Scott Key wrote the Star-Spangled Banner, trapped on a boat while watching bombs tear his home apart.