The American resistance of a British naval attack against the fort in 1814 prevented the capture of Baltimore during the War of 1812. The victory and the bombardment inspired Francis Scott Key to write our national anthem during after the 25-hour battle that he watched from the harbor.