American forces defeated the British when they attempted to capture Baltimore. The Star Spangle Banner was written by Francis Scott Key as he watched the British fail to subdue Fort McHenry.
.
Baltimore was the third largest city in the United States and its harbor was the home of many US privateers, providing an attractive target for British Admiral Cochrane. In the early morning hours of September 12, General Ross ' troops disembarked from the British ships. The defenses at Baltimore were stronger than those of Washington, and the Maryland militia numbered 9,000. Obstacles such as felled trees that the militia had placed in their way immediately slowed the British advance. At 8am, as the British were advancing across the North Point Peninsula between the Bear Creek and Black River, they encountered the Maryland militia. 3,000 militiamen commanded by Brigadier John Stricker were now blocking their way. General Ross stopped for breakfast at a farm for dinner. When asked as he was leaving if he would be back for dinner, Ross is reported to have said- "I will either be in Baltimore or Hell for dinner". A few minutes later Ross rode out near the front of his men , was struck and fatally wounded. The British managed to break through the first two American lines but failed to break the third and their land path to Baltimore was blocked.
Admiral Cochrane then tried to capture Fort McHenry and open the water route to the city. He sent five bomb ketches capable of firing mortar rounds 4,000 yards. Throughout the day and through the night the fort was bombarded. Above the fort hung a large flag.
From the areas outside the fort, the only assurance that the stronghold was withstanding the bombardment was the flag. One of those observers was Francis Scott Key. As day turned into night he wondered whether the fort could withstand such a sustained attack. When the mortars stopped, Key feared that the fort had fallen. When the sun began to rise, Key saw the American flag still flying; he quickly penned down the first verse of what was to become the Star Spangled Banner.