St. John of the Cross, a Carmelite friar and priest during the Counter-Reformation was arrested and jailed by the Calced Carmelites in 1577 at the Carmelite Monastery of Toledo because of his close association with Saint Teresa of Avila in the Discalced Carmelite reforms. He remained imprisoned for nine months in a cell, in bad conditions that caused him much suffering. He memorized, in the absence of the means to write them down, a thirty-one-stanza version of the Canticle. Some years later, after 1582, he wrote down the last stanzas in Baeza and Granada, the last five ones after a conversation with a nun, sister Francisca de la Madre de Dios.
Ana de Jesús asked him to write a comment to his poem, which he did in 1584. It was just Ana de Jesús who after being expelled from Spain took the poem with her, and finally it was published in Paris 1622, but in a French translation from Spanish (having not been published in the first Spanish collection of John's works of 1618). In 1627, it was published in the original Spanish in Brussels, and in the same year was published in Italian, at Rome. In Spain, the poem was first published in the Madrid edition of John's works of 1630.
In the Spiritual Canticle St. John of the Cross tries to explain the mystical process that follows the soul until it reaches its union with God. In order to get this, the poet uses an allegory: the search of the husband (Christ) by the wife (the human soul). The wife feels wounded by love, and this makes it to start the search of the Beloved (el Amado); the soul asks everywhere for him in despair until they finally get together in the solitude of the garden (Paradise).
Two redactions of the Spiritual Canticle exist. The earlier version of thirty-nine stanzas is generally referred to as Canticle A, and is derived from the Manuscript of Sanlúcar. The later version, containing forty stanzas, is generally referred to as Canticle B, and is derived from the Manuscript of Jaén.
One twentieth-century debate concerned whether the Canticle B was John's own work, or that of another author. However, more recent works on John have been willing to accept the authenticity of the Canticle B.