The Kimiya-yi Sa'ādat was written towards the end of his life shortly before 499/1105. During the time before it was written the Muslim world was considered to be in a state of political as well as intellectual unrest. Al-Ghazālī, noted that there were constant disputes regarding the role of philosophy and scholastic theology, and that Sufi's became chastised for their neglect of the ritual obligations of Islam. Upon its release, the Kimiya-yi sa'ādat allowed al-Ghazali to considerably reduce the tensions between the scholars and mystics. Kimiya-yi sa'ādat emphasized the importance of observing the ritual requirements of Islam, the actions that would lead to salvation, and avoidance of sin. The factor that set the Kimiya-yi sa'ādat apart from other theological works at the time was its mystical emphasis on self-discipline and asceticism. Al-Ghazālī, had succeeded in gaining widespread acceptance for Sufism, however, he did so at the expense of the philosophers, despite the fact that his goal was to refute them.