Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:5:118

If You should punish them - indeed they are Your servants; but if You forgive them - indeed it is You who is the Exalted in Might, the Wise.  

If you chastise them, that is, those among them who are fixed upon disbelief, verily they are Your servants, and You are their Master, disposing of them as You will: there can be no objection to ˹what˺ You ˹do˺; and if You forgive them, that is, those of them who are believers, You, only You, are the Mighty, in His affair, the Wise’, in His actions.
القرآن:٥:١١٨

إِنْ تُعَذِّبْهُمْ فَإِنَّهُمْ عِبَادُكَ ۖ وَإِنْ تَغْفِرْ لَهُمْ فَإِنَّكَ أَنْتَ الْعَزِيزُ الْحَكِيمُ  

{إن تعذبهم} أي من أقام على الكفر فيهم {فإنهم عبادك} وأنت مالكهم تتصرف فيهم كيف شئت لا اعتراض عليك {وإن تغفر لهم} أي لمن آمن منهم {فإنك أنت العزيز} الغالب على أمره {الحكيم} في صنعه.

See similar narrations below:

Collected by Nasāʾī, Ibn Mājah, Aḥmad, Ḥākim, Nasāʾī's Kubrá, Aḥmad's Zuhd
nasai:1010Nūḥ b. Ḥabīb > Yaḥyá b. Saʿīd al-Qaṭṭān > Qudāmah b. ʿAbdullāh > Jasrah b. Dajājah > Abū Dhar

"I heard Abu Dharr say: 'The Prophet ﷺ stayed up all night repeating one verse. The verse was: 'If You punish them, they are Your slaves, and if You forgive them, verily, You, only You, are the All-Mighty, the All-Wise.'"  

النسائي:١٠١٠أَخْبَرَنَا نُوحُ بْنُ حَبِيبٍ قَالَ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ الْقَطَّانُ قَالَ حَدَّثَنَا قُدَامَةُ بْنُ عَبْدِ اللَّهِ قَالَ حَدَّثَتْنِي جَسْرَةُ بِنْتُ دَجَاجَةَ قَالَتْ

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

ibnmajah:1350Bakr b. Khalaf Abū Bishr > Yaḥyá b. Saʿīd > Qudāmah b. ʿAbdullāh > Jasrah b. Dajājah > Abū Dhar

“I heard Abu Dharr say: ‘The Prophet ﷺ stood reciting a Verse and repeating it until morning came. That Verse was: “If you punish them, they are Your slaves, and if You forgive them, verily You, only You, are the All- Mighty, the All-Wise.’”” [5:118]  

ابن ماجة:١٣٥٠حَدَّثَنَا بَكْرُ بْنُ خَلَفٍ أَبُو بِشْرٍ حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ عَنْ قُدَامَةَ بْنِ عَبْدِ اللَّهِ عَنْ جَسْرَةَ بِنْتِ دَجَاجَةَ قَالَتْ

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

ahmad:21388Wakīʿ > Qudāmah al-ʿĀmirī > Jasrah b. Dajājahaʿan Abū Dhar

“I heard Abu Dharr say: ‘The Prophet ﷺ stood reciting a Verse and repeating it until morning came. That Verse was: “If you punish them, they are Your slaves, and if You forgive them, verily You, only You, are the All- Mighty, the All-Wise.’”” [5:118] (Using translation from Ibn Mājah 1350)   

أحمد:٢١٣٨٨حَدَّثَنَا وَكِيعٌ حَدَّثَنَا قُدَامَةُ الْعَامِرِيُّ عَنْ جَسْرَةَ بِنْتِ دَجَاجَةَعَنْ أَبِي ذَرٍّ

أَنَّ النَّبِيَّ ﷺ قَرَأَ هَذِهِ الْآيَةَ فَرَدَّدَهَا حَتَّى أَصْبَحَ {إِنْ تُعَذِّبْهُمْ فَإِنَّهُمْ عِبَادُكَ وَإِنْ تَغْفِرْ لَهُمْ فَإِنَّكَ أَنْتَ الْعَزِيزُ الْحَكِيمُ} [المائدة 118]  

hakim:879Abū Bakr b. Isḥāq al-Faqīh > Abū al-Muthanná > Musaddad > Yaḥyá b. Saʿīd > Qudāmah b. ʿAbdullāh al-ʿĀmirī > Jasrah b. Dajājah > Abū Dhar > Qām al-Nabī

“I heard Abu Dharr say: ‘The Prophet ﷺ stood reciting a Verse and repeating it until morning came. That Verse was: “If you punish them, they are Your slaves, and if You forgive them, verily You, only You, are the All- Mighty, the All-Wise.’”” [5:118] (Using translation from Ibn Mājah 1350)  

الحاكم:٨٧٩حَدَّثَنَا أَبُو بَكْرِ بْنُ إِسْحَاقَ الْفَقِيهُ أَنْبَأَ أَبُو الْمُثَنَّى ثنا مُسَدَّدٌ ثنا يَحْيَى بْنُ سَعِيدٍ ثنا قُدَامَةُ بْنُ عَبْدِ اللَّهِ الْعَامِرِيُّ قَالَ حَدَّثَتْنَا جَسْرَةُ بِنْتُ دَجَاجَةَ قَالَتْ

سَمِعْتُ أَبَا ذَرٍّ يَقُولُ قَامَ النَّبِيُّ ﷺ بِآيَةٍ حَتَّى أَصْبَحَ يُرَدِّدُهَا وَالْآيَةُ {إِنْ تُعَذِّبْهُمْ فَإِنَّهُمْ عِبَادُكَ وَإِنْ تَغْفِرْ لَهُمْ فَإِنَّكَ أَنْتَ الْعَزِيزُ الْحَكِيمُ} [المائدة 118] «»  

هَذَا حَدِيثٌ صَحِيحٌ وَلَمْ يُخَرِّجَاهُ صحيح
nasai-kubra:1084Nūḥ b. Ḥabīb > Yaḥyá > Qudāmah b. ʿAbdullāh > Jasrah b. Dajājah > Abū Dhar

“I heard Abu Dharr say: ‘The Prophet ﷺ stood reciting a Verse and repeating it until morning came. That Verse was: “If you punish them, they are Your slaves, and if You forgive them, verily You, only You, are the All- Mighty, the All-Wise.’”” [5:118] (Using translation from Ibn Mājah 1350)  

الكبرى للنسائي:١٠٨٤أَخْبَرَنَا نُوحُ بْنُ حَبِيبٍ قَالَ حَدَّثَنَا يَحْيَى قَالَ حَدَّثَنَا قُدَامَةُ بْنُ عَبْدِ اللهِ قَالَ حَدَّثَتْنِي جَسْرَةُ بِنْتُ دَجَاجَةَ قَالَتْ

سَمِعْتُ أَبَا ذَرٍّ يَقُولُ قَامَ النَّبِيُّ ﷺ حَتَّى أَصْبَحَ بِآيَةٍ وَالْآيَةُ {إِنْ تُعَذِّبْهُمْ فَإِنَّهُمْ عِبَادُكَ وَإِنْ تَغْفِرْ لَهُمْ فَإِنَّكَ أَنْتَ الْعَزِيزُ الْحَكِيمُ} [المائدة 118]  

nasai-kubra:11096Nūḥ b. Ḥabīb > Yaḥyá / Ibn Saʿīd > Qudāmah b. ʿAbdullāh > Jasrah b. Dajājah > Abū Dhar

“I heard Abu Dharr say: ‘The Prophet ﷺ stood reciting a Verse and repeating it until morning came. That Verse was: “If you punish them, they are Your slaves, and if You forgive them, verily You, only You, are the All- Mighty, the All-Wise.’”” [5:118] (Using translation from Ibn Mājah 1350)  

الكبرى للنسائي:١١٠٩٦أَخْبَرَنَا نُوحُ بْنُ حَبِيبٍ حَدَّثَنَا يَحْيَى يَعْنِي ابْنَ سَعِيدٍ حَدَّثَنَا قُدَامَةُ بْنُ عَبْدِ اللهِ حَدَّثَتْنِي جَسْرَةُ بِنْتُ دَجَاجَةَ قَالَتْ

سَمِعْتُ أَبَا ذَرٍّ يَقُولُ قَامَ النَّبِيُّ ﷺ حَتَّى أَصْبَحَ بِآيَةٍ وَالْآيَةُ {إِنْ تُعَذِّبْهُمْ فَإِنَّهُمْ عِبَادُكَ وَإِنْ تَغْفِرْ لَهُمْ فَإِنَّكَ أَنْتَ الْعَزِيزُ الْحَكِيمُ} [المائدة 118]  

ahmad-zuhd:91ʿAbdullāh from my father > Wakīʿ > Qudāmah al-ʿĀmirī > Jasrah b. Dajājah > Abū Dhar

If You should punish them - indeed they are Your servants; but if You forgive them - indeed it is You who is the Exalted in Might, the Wise. (Using translation from Qurʾān 5:118)   

الزهد لأحمد:٩١حَدَّثَنَا عَبْدُ اللَّهِ حَدَّثَنَا أَبِي حَدَّثَنَا وَكِيعٌ حَدَّثَنَا قُدَامَةُ الْعَامِرِيُّ عَنْ جَسْرَةَ بِنْتِ دَجَاجَةَ عَنْ أَبِي ذَرٍّ

عَنِ النَّبِيِّ ﷺ أَنَّهُ رَدَّدَ هَذِهِ الْآيَةَ حَتَّى أَصْبَحَ {إِنْ تُعَذِّبْهُمْ فَإِنَّهُمْ عِبَادُكَ وَإِنْ تَغْفِرْ لَهُمْ فَإِنَّكَ أَنْتَ الْعَزِيزُ الْحَكِيمُ} [المائدة 118]