Hadithcore
Mishkat al-Masabih, 1205

Abu Dharr said that God’s Messenger kept awake during the night till morning reciting one verse, which was, “If You punishest them they are Your servants; and if You forgivest them You are the Mighty, the Wise”(Al-Qur’an; 5:118). Nasa’i and Ibn Majah transmitted it.

وَعَنْ أَبِي ذَرٍّ قَالَ: قَامَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ حَتَّى أَصْبَحَ بِآيَةٍ وَالْآيَةُ: (إِنْ تُعَذِّبْهُمْ فَإِنَّهُمْ عِبَادُكَ وَإِنْ تَغْفِرْ لَهُمْ فَإنَّك أَنْت الْعَزِيز الْحَكِيم) رَوَاهُ النَّسَائِيّ وَابْن مَاجَه

References1 variant
In-Book Reference
Book 4, Hadith 621