Hadith 5700
وَعَنْ أَبِي هُرَيْرَةَ قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ: إِنَّ اللَّهَ تَعَالَى كَتَبَ كِتَابًا قَبْلَ أَنْ يَخْلُقَ الْخَلْقَ: إِنَّ رَحْمَتِي سَبَقَتْ غَضَبِي فَهُوَ مَكْتُوب عِنْده فَوق الْعَرْش . مُتَّفق عَلَيْهِ
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.)
Hadith Reference Mishkat al-Masabih / The Book of the Conditions of the Day of Resurrection and the Beginning of Creation / Hadith: 5700
Hadith Grading الألبانی: مُتَّفَقٌ عَلَيْهِ  |  زبیر علی زئی: متفق عليه
Hadith Takhrij ´تحقيق و تخريج: محدث العصر حافظ زبير على زئي رحمه الله` «متفق عليه، رواه البخاري (7554) ومسلم (14/ 2751)»