The Song of the Germans, also known as the Deutschlandlied, was written by August Heinrich Hoffmann von Fallersleben on 26 August 1841 on Helgoland. Its third stanza is the text of the German national anthem.

The specific occasion for Hoffmann to write the song was French territorial claims to the Rhineland during the Rhine crisis. He rejected these claims with the song, as he did with other German Rhine songs of the time. He supplemented this with other ideas, especially that of German unity, which alone could provide the prerequisite for repelling enemy attacks of any magnitude (first stanza). The poet created his work expressly to the tune of the older song Gott erhalte Franz, den Kaiser by Joseph Haydn (1797). The song was written on a trip Hoffmann took to the then British island of Heligoland. For a long time, however, it was only one of the many songs of the German national movement.

The song only gained greater significance during the First World War when the Supreme Army Command (OHL) announced that it had been spontaneously sung by German soldiers during a battle near the Belgian town of Langemarck, north of Ypres. On the following day, the OHL commented on the events of November 10, 1914, in an obviously propagandistically formulated, momentous report that was printed on the front page of almost all German newspapers:

"West of Langemarck, young regiments, chanting 'Germany, Germany above all,' broke against and took the first line of enemy positions. About 2,000 men of French line infantry were captured and six machine guns captured."

- Report of the OHL, November 11, 1914

This report by the OHL was received uncritically by large sections of the German public and triggered the creation of the so-called myth of Langemarck about the heroic sacrifice of young soldiers. It was not until 11 August 1922, during the Weimar Republic, that the Deutschlandlied with all three stanzas was designated Germany's official national anthem at the instigation of the Social Democratic Reich President Friedrich Ebert.

Shortly after the lost First World War, an additional "fourth verse" was created, which was never part of the national anthem. It was included, among others, in the Weltkriegs-Liedersammlung (1926), in the Liederbuch der Deutschen Kriegsmarine (1927) and in the Schlesier-Liederbuch (1936). There Albert Matthai is named as the author. Matthai wrote this stanza under the impression of the Versailles Peace Treaties, which entailed harsh sanctions for Germany such as cessions of territory and high reparation payments. It was sung until the 1930s in front-line fighter associations such as the "Stahlhelm" and among German nationalists.

During the time of National Socialism (1933-1945) only the first verse was sung, which was always followed by the Horst-Wessel-Lied.

After 1945, there were discussions about the further use of the song until 1952, when an official exchange of letters between Federal President Theodor Heuss (FDP) and Federal Chancellor Konrad Adenauer (CDU) decided that Das Lied der Deutschen remained the national anthem overall, but that only the third verse should be sung on official occasions. After reunification, the third verse was declared the national anthem of Germany in 1991, following another exchange of letters between Federal President Richard von Weizsäcker (CDU) and Federal Chancellor Helmut Kohl (CDU).