The Messenger of Allah ﷺ said, "When Allah created creation, He wrote with His own hand concerning Himself, 'My mercy prevails over My wrath.'"
عن رسول الله ﷺ قال: إن الله حين خلق الخلق كتب بيده على نفسه: إن رحمتي تغلب غضبي.
Tirmidhi (3543) and Ibn Majah (189, 4295) both narrated it through Ibn Ajlan (that is, Yahya), from his father, from Abu Hurairah, and he related the hadith. Ahmad (9597) also narrated it by this same route, as did Ibn Khuzayma in Kitab Tawhid (8, 79) and Ibn Hibban in his Sahih (6145). Tirmidhi said, "Hasan sahih."I say, it is hasan only, because of the criticism concerning Ibn Ajlan's narration from Abu Hurairah, but he was not alone in narrating it, for two others corroborated him.The first is Abu Rafi, as found in Sunnah (608) by Ibn Abu Asim, with the wording, "When Allah finished creation, He wrote in a book with Him, 'My mercy has overcome' or he said 'has preceded My wrath,' and it is with Him above the Throne." Or something to that effect. Abu Rafi is Nufay the Goldsmith, trustworthy and reliable.The second is Abu Salih, from Abu Hurairah, with the wording, "Allah wrote a book with His own hand for Himself before He created the heavens and the earth, and placed it beneath His Throne, in which it says, 'My mercy has preceded My wrath.'" Imam Ahmad (9159) narrated it from Muhammad bin Sabiq, who said Sharik narrated to us, from Amash, from Abu Salih, with this wording. Sharik is Ibn Abdullah the Judge, an-Nakhai. There has been criticism of him regarding his memory, but he was corroborated, which shows that he did not err in this narration, and through these corroborations his statement "with His hand" is established, even though the hadith appears in the Sahihayn without it, as in the chapter, "Allah wrote in His Book, 'My mercy has overcome My wrath.'" It also states that He placed it above His Throne.The linguists say that "above" (fawq) is one of those words with contrary meanings used in the Arabic language, by which "below" is sometimes intended, as in His saying, "Indeed, Allah does not shy away from citing the example of a mosquito or something smaller than it" [Baqarah 2:26], meaning something lesser than it.Regarding His statement "upon Himself," Ibn Khuzayma said, "Allah
has affirmed in verses of His Book that He has a Self, and He likewise made clear through the tongue of His Prophet that He has a Self, just as He affirmed the Self in His Book. The Jahmiyyah disbelieved in these verses and these hadiths, and some of their ignorant ones claimed that Allah Most High only attributed the Self to Himself in the sense of attributing creation to Himself, and claimed that His Self is a creation like everything else He created. This is something no person of intellect and knowledge would even imagine, let alone speak. Allah has made known, in the clear verses of His revelation, that He has written mercy upon Himself. Would any Muslim imagine that Allah Most High wrote mercy upon someone other than Himself? And He has warned His servants of Himself. Would it be permissible for a Muslim to say that Allah warned His servants of someone other than Himself, or to interpret His saying to the one He spoke to directly, Musa, "and I chose you for Myself" [Taha 20:41], by claiming its meaning is 'I chose you for someone other than Myself among creation,' or to say that by His saying, "and I do not know what is in Yourself" [Maidah 5:116], the Spirit of Allah meant 'I do not know what is in someone other than You'? This is something no Muslim would imagine, and no one would say it except a disbelieving denier of the divine attributes." End of quote.Shaykh Khalil Harras, commenting on Ibn Khuzayma's statement, said, "The Self is affirmed for Allah
through the verses and the sahih hadiths. The people of truth affirm this and refrain from going beyond it into delving into its reality or its nature, and they declare Allah free from any resemblance between His Self and the selves of created beings, just as affirming it does not require, in their view, that He be composed of a self and a body. Allah is exalted far above that." End of quote.