This song has been used wholly or partially as the national anthem of Germany since 1922. Austrian composer Joseph Haydn (1732-1809) wrote the music in 1797, during the Napoleonic wars as an anthem for the birthday of the Austrian Emperor Francis II. As "Gott erhalte Franz den Kaiser"(God Save Franz the Emperor), it was first performed on the Emperor's birthday, February 12, 1797 and the song subsequently became Austria's national anthem. New words were set to the music in 1841 by a German poet, August Heinrich Hoffmann, and his "Das Lied der Deutschen," (The Song of the Germans) was considered revolutionary at the time. In order to endorse its republican and liberal tradition, the tune was chosen as the national anthem of Germany in 1922, during the Weimar Republic. By now the song was being titled "Deutschland, Deutschland uber Alles," (Germany, Germany over All). Other patriotic tunes supplemented it after the Nazi party took control of the government. After the fall of Adolf Hitler, Germany had no national anthem until 1950, when the West German government re-adopted Haydn's tune. Upon German reunification in 1990, it was confirmed as the national anthem, with only the third stanza sung on official occasions.

The melody, along with several variations, is also the second movement of one of Haydn's most famous string quartets, his string quartet Op. 76 No. 3, nicknamed the "Emperor Quartet."