The bombardment of Fort McHenry that inspired Francis Scott Key to write the lyrics for the national anthem.
American patriotic music owes its origins to four main wars — the American Revolution, the War of 1812, the American Civil War, and the Spanish American War. During the period prior to American independence, much of America's patriotic music was aligned with the political ambitions of the British in the new land. In 1803, the British engaged Charles Dibdin, whose music was considered a potent influence in war, to write a series of songs to "keep alive the national feelings against the French.
"The Liberty Song", written by John Dickinson in 1768 to the music of William Boyce's "Heart of Oak", is perhaps the first patriotic song written in America. The song contains the line "by uniting we stand, by dividing we fall", the first recorded use of the sentiment. The American Revolution produced three popular patriotic tunes — "British Grenadiers", "God Save the King" and "Yankee Doodle". Political and cultural links between the colony and Great Britain can perhaps explain the popularity of the two former tunes, despite the war for independence. In 1814, a Washington lawyer Francis Scott Key wrote the Star Spangled Banner, later to become the country's national anthem, in response to witnessing the bombardment of Fort McHenry in Baltimore during the War of 1812.
During the events leading up to the American Civil War, both the north and the south generated a number of songs to stir up patriotic sentiments such as Battle Hymn of the Republic. However, after the Civil War, the sentiments of most patriotic songs were geared to rebuilding and consolidating the United States. During the Spanish-American War in the 1890s, songwriters continued to write patriotic tunes that honored America's soldiers and their victories. Songs such as "Brave Dewey and His Men" and "The Chare of the Roosevelt Riders" lauded Commodore George Dewey and Theodore Roosevelt. Songs such as "The Black KPs"', likely labelled rascist and offensive by modern listeners, were intended to rally the public behind the war effort.
World War I, the "War to end all wars" produced patriotic American songs such as "It's a Long Long Way to Tipperary" by popular songwriter Arthur Fields, "K-K-K-Kathy" and "Uncle Sam". "God Bless America", written in 1918 by Irving Berlin, is sometimes referred to as the unofficial national anthem of the United States. In 1940, Woody Guthrie wrote "This Land Is Your Land" in response to his dislike of "God Bless America", calling it unrealistic and complacent. The World War II era produced a significant number of patriotic songs in the Big Band and Swing format. Popular patriotic songs of the time included "Remember Pearl Harbor" and "God Bless America". Patriotic songs in latter half of the 20th century included "Ballad of the Green Berets" during the Vietnam War and Lee Greenwood's "God Bless the USA" during the years of the first Gulf War.