Luther wrote the hymn probably in 1541 when a prayer service was held in Wittenberg against the perceived danger of the Turks when Ferdinand of Austria lost most of Hungary to the Ottoman Empire at Siege of Buda. The second line of the first verse reads "und steur' des Papsts und Türken Mord" (And control the murder by the Pope and Turks). Luther may have contributed the hymn for a boys' choir. It was published as a broadsheet in 1542. In Klug's hymnal "Geistliche Lieder" it was titled a "A hymn for the children to sing against the two arch-enemies of Christ, and His Holy Church, the Pope and the Turks" ("Ein Kinderlied, zu singen wider die zween Ertzfeinde Christi und seiner heiligen Kirchen, den Bapst und Türcken"). Luther wrote three stanzas, each one related to a person of the Trinity: "Erhalt uns, Herr", "Beweis dein Macht, Herr Jesu Christ", and "Gott, Heilger Geist". More stanzas were added in later editions, most prominently by Justus Jonas, who wrote probably in 1545, referring to the Council of Trent, two more stanzas, "Ihr Anschläg, Herr, zu nichte mach" and "So werden wir erkennen doch". These five stanzas appeared in Breslau in 1546 as No. 723 in Burg's hymnal.