This famous ecumenical hymn was written in 1529, by Martin Luther. He was a German professor of theology, composer, priest and monk who became the seminal figure in the Protestant Reformation. Luther thought the singing of hymns to be significant in motivating the believer and fully believed the Bible was God speaking to man and hymns were man speaking to God.
About this hymn in particular, Luther himself said, "We sing this psalm to the praise of God, because God is with us and powerfully and miraculously preserves and defends his church and his word against all fanatical spirits, against the gates of hell, against the implacable hatred of the devil, and against all the assaults of the world, the flesh and sin.”