1. The Star-Spangled Banner

The story behind America’s anthem dates back to the War of 1812’s Battle of Baltimore. In September 1814, American attorney Francis Scott Key sailed out to the British fleet in the Chesapeake Bay to negotiate the release of an imprisoned friend. Detained overnight, he watched with bated breath as the British moved on Baltimore and rained over 1,800 rockets and bombs on nearby Fort McHenry. A defeat seemed imminent, but when dawn finally broke, Key was overjoyed to see the American flag still waving over the fort—a clear sign that it had not fallen to the British.

Key scribbled down the poem that became “The Star-Spangled Banner” that day, and by September 20, his patriotic words had found their way into a Baltimore newspaper. The song—ironically set to the melody of a British tune—later became popular in the armed forces, but it wasn’t until 1931 that it was formally adopted as the American national anthem.

2. The Mexican National Anthem

Francisco Gonzalez Bocanegra won a countrywide contest to write Mexico’s “Himno Nacional” in 1853, yet if it were up to him, he never would have participated. A skilled poet, Bocanegra was more concerned with composing beautiful verse than patriotic song lyrics, and he initially resisted President Santa Anna’s call for would-be national anthems. According to legend, his young fiancée was so sure he could win that she locked him in a bedroom and ordered him to pen an entry to the contest in exchange for his freedom. Just four hours later, Bocanegra emerged with a ten-verse poem celebrating Mexico’s struggles and revolutionary heritage. The reluctant effort was later chosen as the country’s new national song by unanimous decision.

3. God Save the Queen (Great Britain)

Britain’s anthem is one of the world’s most famous—and often copied—national songs, yet its origins remain cloaked in mystery. The lyrics and melody first appeared in magazines and music anthologies around 1745, when they were often performed to show support for King George II during the final Jacobite uprising, but the song’s true author is unknown. Possible candidates include organist and musician John Bull, baroque composer Henry Purcell and the dramatist Henry Carey.

“God Save the Queen”—altered to “God Save the King” whenever a man sits on the throne—later became a popular motif among composers such as Beethoven, Handel and Brahms, and by the early 19th century it was viewed as the unofficial national anthem of the monarchy. The song also inspired numerous imitators. Lichtenstein’s national anthem lifted the melody note for note, as did the American patriotic song “My Country, ‘Tis of Thee.”

4. The Bayamo Anthem (Cuba)

Cuba’s Bayamo Anthem arose during the Ten Years’ War, one of the island nation’s early attempts to win independence from Spain. Lawyer, musician and rebel leader Pedro “Perucho” Figueredo originally composed the melody in 1867, but the song didn’t get words until October 1868, when revolutionary forces claimed the city of Bayamo. As his fellow freedom fighters rejoiced, Perucho, still on horseback, took a scrap of paper from his pocket and scribbled down two verses of lyrics celebrating Cuba’s revolutionary spirit. The song became a popular battle hymn for the Cuban forces, but Perucho was later captured and executed by firing squad in 1870. Just before the shots were fired, he is said to have shouted one of the most famous lines from the anthem: “Who dies for his country lives!”

5. The Song of the Germans

The long and checkered history of the “Deutschlandlied,” or “Song of the Germans,” began in 1841, when the poet Heinrich Hoffmann von Fallersleben penned its lyrics as a rallying cry for supporters of a unified Germany. Set to a melody by famed composer Joseph Haydn, the song later became one of the German Empire’s most cherished national hymns. It was particularly popular among the military, and during World War I, German troops often belted it out from the trenches to identify their position and avoid friendly fire artillery deaths. Shortly after the war, the Weimar Republic selected the tune as the official national anthem.In the 1930s, the Nazis turned the “Deutschlandlied” into a symbol of fascism by combining its first verse—which included the famous line “Deutschland, Über Alles” (“Germany, Above All”)—with the official Nazi party song. Allied forces briefly banned the song after the war, but it was later restored as the national anthem—minus the now-tainted first verse—after the reunification of Germany in 1990.

6. National Anthem of South Africa

Prior to the end of apartheid in 1994, South Africa had dueling national anthems. The official state song was “Die Stem,” known in English as “The Call of South Africa,” but the country also had an unofficial national hymn in “Nkosi Sikolel’ iAfrika,” or “God Bless Africa.” In a land sharply divided along racial lines, “Die Stem” was seen as the preferred national hymn of the white population, while “God Bless Africa” was more closely tied to blacks, who employed it as a song of protest against apartheid.

The rival tunes stood as a musical symbol of South Africa’s troubled history until 1994, when newly elected President Nelson Mandela announced that “Die Stem” and “God Bless Africa” would share honors as the national anthem. Finally, in 1997, the two anthems were blended into a single song that incorporated lyrics from each. In an unusual twist, the new anthem also included lyrics in five of South Africa’s most commonly spoken languages: Xosa, Zulu, Sesotho, Afrikaans and English.

7. Kimigayo (Japan)

The “Kimigayo” officially became Japan’s national anthem in 1999, but its lyrics date all the way back to a piece of 10th century verse written in honor of the Japanese Emperor. The poem was used in folk songs as early as the Middle Ages, but it wasn’t established as a patriotic tune until 1869, when a British music teacher working in Yokohama first set it to music for use as a national hymn. The Kimigayo was then updated to its current form in the 1880s, and eventually became Japan’s unofficial national song after the country’s Education Ministry decreed that it should be sung in schools. Its plaintive melody was transformed into a symbol of Japanese militarism during World War II, but the song endured through the post-war era and into the 1950s, when it was reintroduced as part of an effort to restore Japanese patriotism. The Kimigayo is often noted for its extreme brevity—at a breezy five lines, it’s one of the world’s shortest national anthems.

8. La Marseillaise (France)

One of the world’s most recognizable national anthems, the famed “Marseillaise” dates back to the height of the French Revolution. The song was composed in April 1792 by Claude Joseph Rouget de Lisle, a French soldier and musician then stationed in Strasbourg. De Lisle wrote the march in support of a war with Austria—its original title was “War Song of the Army of the Rhine”—but its spirited melody proved more popular among revolutionaries gunning for the head of King Louis XVI. The tune became known as “La Marseillaise” after republican volunteers from Marseilles sang it during their long march into Paris, and it was later adopted as the new French republic’s national anthem in 1795. Ironically, despite having accidentally penned its battle hymn, the royalist De Lisle would only narrowly escaped the guillotine under the revolutionary government.

The Marseillaise was later banned by Napoleon and several other French monarchs and wasn’t officially restored as the national anthem until 1879. Since then, the song has often come under fire for its violent lyrics, which make vivid reference to throat cuttings, vanquished enemies, and fields running red with blood.