Deutschlandlied genre anthem
The "Deutschlandlied" (German pronunciation: [ˈdɔʏtʃlantˌliːt] (listen); "Song of Germany"), officially titled "Das Lied der Deutschen" (German: [das ˌliːt dɛːʁ ˈdɔʏtʃn̩]; "The Song of the Germans"), has been the national anthem of Germany either wholly or in part since 1922, except for a seven-year gap following World War II in West Germany. In East Germany, the national anthem was "Auferstanden aus Ruinen" ("Risen from Ruins") between 1949 and 1990.
Since World War II and the fall of Nazi Germany, only the third stanza has been used as the national anthem. Its incipit "Einigkeit und Recht und Freiheit" ("Unity and Justice and Freedom") is considered the unofficial national motto of Germany, and is inscribed on modern German Army belt buckles and the rims of some German coins.
The music is the hymn "Gott erhalte Franz den Kaiser", written in 1797 by the Austrian composer Joseph Haydn as an anthem for the birthday of Francis II, Emperor of the Holy Roman Empire and later of Austria. In 1841, the German linguist and poet August Heinrich Hoffmann von Fallersleben wrote the lyrics of "Das Lied der Deutschen" as a new text for that music, counterposing the national unification of Germany to the eulogy of a monarch: lyrics that were considered revolutionary at the time.
The "Deutschlandlied" was adopted as the national anthem of Germany in 1922, during the Weimar Republic, to which all three stanzas were used. West Germany retained it as its official national anthem in 1952, with only the third stanza sung on official occasions. After German reunification in 1990, in 1991 only the third stanza was reconfirmed as the national anthem. It is discouraged, although not illegal, to perform the first stanza (or to some degree, the second), due to association with the Nazi regime or previous nationalist sentiment.Melody
The melody of the "Deutschlandlied", also known as “the Austria tune”, was written by Joseph Haydn in 1797 to provide music to the poem "Gott erhalte Franz den Kaiser" ("God save Francis the Emperor") by Lorenz Leopold Haschka. The song was a birthday anthem honouring Francis II (1768–1835), Habsburg emperor, and was intended as a parallel to Great Britain's "God Save the King". Haydn's work is sometimes called the "Emperor's Hymn" (Kaiserhymne). It was the music of the National Anthem of Austria-Hungary until the abolition of the Habsburg Monarchy in 1918. It is often used as the musical basis for the hymn "Glorious Things of Thee Are Spoken".
It has been conjectured that Haydn took the first four measures of the melody from a Croatian folk song. This hypothesis has never achieved unanimous agreement; an alternative theory reverses the direction of transmission, positing that Haydn's melody was adapted as a folk tune. For further discussion, see Haydn and folk music. 
Haydn later used the hymn as the basis for the second movement (Poco adagio cantabile) of his String Quartet No. 62 in C major, Opus 76 No. 3, often called the "Emperor" or "Kaiser" quartet.
category style type kind class