<P> Much of the idea of the poem, including the flag imagery and some of the wording, is derived from an earlier song by Key, also set to the tune of "The Anacreontic Song". The song, known as "When the Warrior Returns", was written in honor of Stephen Decatur and Charles Stewart on their return from the First Barbary War . Absent elaboration by Francis Scott Key prior to his death in 1843, some have speculated in modern times about the meaning of phrases or verses . According to British historian Robin Blackburn, the words "the hireling and slave" allude to the thousands of ex-slaves in the British ranks organised as the Corps of Colonial Marines, who had been liberated by the British and demanded to be placed in the battle line "where they might expect to meet their former masters ." Nevertheless, Professor Mark Clague, a professor of musicology at the University of Michigan, argues that the "middle two verses of Key's lyric vilify the British enemy in the War of 1812" and "in no way glorifies or celebrates slavery ." Clague writes that "For Key...the British mercenaries were scoundrels and the Colonial Marines were traitors who threatened to spark a national insurrection ." This harshly anti-British nature of Verse 3 led to its omission in sheet music in World War I, when Britain and the U.S. were allies . Responding to the assertion of writer Jon Schwarz of The Intercept that the song is a "celebration of slavery," Clague said that: "The reference to slaves is about the use and in some sense the manipulation, of black Americans to fight for the British, with the promise of freedom . The American forces included African - Americans as well as whites . The term' freemen,' whose heroism is celebrated in the fourth stanza, would have encompassed both ." </P> <P> Others suggest that "Key may have intended the phrase as a reference to the British Navy's practice of impressment (kidnapping sailors and forcing them to fight in defense of the crown), or as a semi-metaphorical slap at the British invading force as a whole (which included a large number of mercenaries)." </P> <P> Key gave the poem to his brother - in - law Judge Joseph H. Nicholson who saw that the words fit the popular melody "The Anacreontic Song", by English composer John Stafford Smith . This was the official song of the Anacreontic Society, an 18th - century gentlemen's club of amateur musicians in London . Nicholson took the poem to a printer in Baltimore, who anonymously made the first known broadside printing on September 17; of these, two known copies survive . </P> <P> On September 20, both the Baltimore Patriot and The American printed the song, with the note "Tune: Anacreon in Heaven". The song quickly became popular, with seventeen newspapers from Georgia to New Hampshire printing it . Soon after, Thomas Carr of the Carr Music Store in Baltimore published the words and music together under the title "The Star Spangled Banner", although it was originally called "Defence of Fort M'Henry". Thomas Carr's arrangement introduced the raised fourth which became the standard deviation from "The Anacreontic Song". The song's popularity increased and its first public performance took place in October when Baltimore actor Ferdinand Durang sang it at Captain McCauley's tavern . Washington Irving, then editor of the Analectic Magazine in Philadelphia, reprinted the song in November 1814 . </P>

Where did the melody of the star spangled banner come from