Abu Huraira told that he heard God's messenger say God most high had inscribed a document before bringing the creation into being, "My mercy has preceded my anger," and that it is written in His presence above the throne. (Bukhari and Muslim.)