At the end of 1523, Luther paraphrased Psalm 12,, in Latin Salvum me fac, attempting to make the psalms accessible to Protestant church services in German. Luther's poetry first follows the verses of the psalm exactly, then combines two verses to one. He expands the content of the psalm to show the precise situation of the early Reformation as a time of conflict. The hymn was first printed as one page inserted in the Wittenberger Dreiliederblatt. It was one of eight hymns of the first Lutheran hymnal, published 1524 in Nuremberg under the title Etlich Cristlich lider, also called Achtliederbuch. The same year it appeared in Erfurt in Eyn Enchiridion. The hymn was soon used as a Protestant Kampflied. The chorale became the Lutheran Hauptlied for the second Sunday after Trinity.
Melody
In the first Lutheran hymnal the melody was the same as for "Es ist das Heil uns kommen her" by Paul Speratus. In the Erfurt Enchiridion, also in 1524, the text first appeared with a tune codified by Martin Luther, Zahn No. 4431, which was derived from the secular song "Begierlich in dem Herzen mein" from about 1410. This melody is in Phrygian mode, preferred by Luther for texts of repentance, such as "Aus tiefer Not schrei ich zu dir". In Johann Walter's hymnal Eyn geystlich Gesangk Buchleyn, published in Wittenberg in 1524, it appeared with a different melody.
Musical settings
The Zahn No. 4431 melody was set by composers for instruments like harpsichord and organ, and for voices.
set the chorale as part of the Becker Psalter. Bach used the complete chorale as the base for Ach Gott, vom Himmel sieh darein, BWV 2, a chorale cantata composed in 1724, but also in others as four-part settings. Wilhelm Friedemann Bach set the chorale as a church cantata. Felix Mendelssohn composed in 1832 a chorale cantata for baritone, mixed choir and orchestra. Mozart used the melody in his opera Die Zauberflöte in act 2, Finale, scene 10, when the two "Geharnischte" recite it in unison on Schikaneder's words "Der, welcher wandert diese Strasse voll Beschwerden" as a cantus firmus of a Baroque-style chorale prelude. Alfred Einstein comments in his biography Mozart / His Character, His Work:
In the second act it is the final test of the lovers, the "'test of fire and water", for which Mozart called into play every musical means at his disposal and for which he ordained extreme simplicity, extreme mastery; the scene of the men in armor, which he constructed in the form of a chorale prelude, building upon a solemn fugato around the chorale Ach Gott, vom Himmel sieh darein...