The Messenger of Allah ﷺ said, "When Allah finished creating, He wrote in His book, which is with Him above the Throne, 'My mercy has overcome My wrath.'"
قال رسول الله ﷺ: لما قضى الله الخلق كتب في كتابه فهو عنده فوق العرش: إن رحمتي غلبت غضبي.
Bukhari narrated it in the Beginning of Creation (3194), and Muslim in Repentance (2751), both from Qutayba bin Saeed, who said, Mughira bin Abdul-Rahman Qurashi narrated to us, from Abu Zinad, from Araj, from Abu Hurairah, who mentioned it.