وَعَنْ أَبِي هُرَيْرَةَ قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ: " إِنَّ اللَّهَ تَعَالَى كَتَبَ كِتَابًا قَبْلَ أَنْ يَخْلُقَ الْخَلْقَ: إِنَّ رَحْمَتِي سَبَقَتْ غَضَبِي فَهُوَ مَكْتُوب عِنْده فَوق الْعَرْش ". مُتَّفق عَلَيْهِ
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.)
Grade (as given by the source): الألباني: مُتَّفَقٌ عَلَيْهِ