At dawn on the 14th, Key noted that the huge American flag, which now hangs in the Smithsonian National Museum of American History was still waving and had not been removed in defeat. The sight inspired him to write a poem titled Defense of Fort McHenry.
The poem was eventually set to music that had originally been written by English composer John Stafford Smith for a song titled "The Anacreontic Song". The end result was the inspiring song now considered the national anthem of the United States of America.
It was accepted as such by public demand for the next century or so, but became even more accepted as the national anthem during the World Series of Baseball in 1917 when it was sung in honor of the brave armed forces fighting in the Great War. The World Series performance moved everyone in attendance, and after that it was repeated for every game. Finally, on March 3, 1931, the American Congress proclaimed it as the national anthem, 116 years after it was first written.
The History Channel