Language:
كتاب التوحيد
97  
Oneness, Uniqueness of Allah (Tawheed)
(55)
Chapter: “Nay! This is a Glorious Qur'an, in Al-Lauh Al-Mahfuz.
(55)
Sahih al-Bukhari 7553

Narrated Abu Huraira:

I heard Allah's Messenger (ﷺ) saying, "Before Allah created the creations, He wrote a Book (wherein He has written): My Mercy has preceded my Anger." and that (Book) is written with Him over the Throne."

وَقَالَ لِي خَلِيفَةُ بْنُ خَيَّاطٍ حَدَّثَنَا مُعْتَمِرٌ، سَمِعْتُ أَبِي، عَنْ قَتَادَةَ، عَنْ أَبِي رَافِعٍ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ لَمَّا قَضَى اللَّهُ الْخَلْقَ كَتَبَ كِتَابًا عِنْدَهُ غَلَبَتْ ـ أَوْ قَالَ سَبَقَتْ ـ رَحْمَتِي غَضَبِي‏.‏ فَهْوَ عِنْدَهُ فَوْقَ الْعَرْشِ ‏"‏‏.‏
Reference : Sahih al-Bukhari 7553
In-book reference : Book 97, Hadith 178
USC-MSA web (English) reference : Vol. 9, Book 93, Hadith 643
  (deprecated numbering scheme)