Sunan Ibn Majah (Ibn Majah 189)

It was narrated that Abu Hurairah said:

"The Messenger of Allah said: 'Your Lord wrote for Himself with His Own Hand before He created the creation: "My mercy precedes My wrath."