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.
bayhaqi:15794[Chain 1] Abū ʿAlī al-Rūdhbārī > Abū Bakr b. Dāsah > Abū Dāwud > Abū Kāmil > ʿAbd al-Wāḥid [Chain 2] Abū al-Ḥasan ʿAlī b. Muḥammad b. ʿAlī al-Muqriʾ > al-Ḥasan b. Muḥammad b. Isḥāq > Yūsuf b. Yaʿqūb al-Qāḍī > Muḥammad b. Abū Bakr > ʿAbd al-Wāḥid b. Ziyād > al-Aʿmash > Ibrāhīm al-Taymī from his father > Abū Masʿūd

I was beating my slave with a whip when I heard a voice behind me: Understand, Abu Masud; but I did not recognise the voice due to intense anger. He (Abu Mas'ud) reported: As he came near me (I found) that he was the Messenger of Allah ﷺ and he was saying: Bear in mind, Abu Mas'ud; bear in mind. Abu Mas'ud. He (Aba Maslad) said: threw the whip from my hand. Thereupon he (the Holy Prophet) said: Bear in mind, Abu Mas'ud; verily Allah has more dominance upon you than you have upon your slave. I (then) said: I would never beat my servant in future. (Using translation from Muslim 1659a)   

البيهقي:١٥٧٩٤أَخْبَرَنَا أَبُو عَلِيٍّ الرُّوذْبَارِيُّ أَنْبَأَنَا أَبُو بَكْرِ بْنُ دَاسَةَ ثنا أَبُو دَاوُدَ ثنا أَبُو كَامِلٍ ثنا عَبْدُ الْوَاحِدِ عَنْ ح وَأَخْبَرَنَا أَبُو الْحَسَنِ عَلِيُّ بْنُ مُحَمَّدِ بْنِ عَلِيٍّ الْمُقْرِئُ أنبأ الْحَسَنُ بْنُ مُحَمَّدِ بْنِ إِسْحَاقَ ثنا يُوسُفُ بْنُ يَعْقُوبَ الْقَاضِي ثنا مُحَمَّدُ بْنُ أَبِي بَكْرٍ ثنا عَبْدُ الْوَاحِدِ بْنُ زِيَادٍ ثنا الْأَعْمَشُ عَنْ إِبْرَاهِيمَ التَّيْمِيِّ عَنْ أَبِيهِ عَنْ أَبِي مَسْعُودٍ قَالَ كُنْتُ أَضْرِبُ غُلَامًا لِي بِالسَّوْطِ

فَسَمِعْتُ صَوْتًا مِنْ خَلْفِي اعْلَمْ أَبَا مَسْعُودٍ فَلَمْ أَفْهَمِ الصَّوْتَ مِنَ الْغَضَبِ فَقَالَ اعْلَمْ أَبَا مَسْعُودٍ فَلَمَّا دَنَا مِنِّي إِذَا هُوَ رَسُولُ اللهِ ﷺ فَقَالَ اعْلَمْ أَبَا مَسْعُودٍ أَنَّ اللهَ ﷻ أَقْدَرُ عَلَيْكَ مِنْكَ عَلَى هَذَا الْغُلَامِ فَأَلْقَيْتُ السَّوْطَ مِنْ يَدِي وَقُلْتُ لَا أَضْرِبُ غُلَامًا بَعْدَ الْيَوْمِ أَبَدًا  

رَوَاهُ مُسْلِمٌ فِي الصَّحِيحِ عَنْ أَبِي كَامِلٍ

See similar narrations below:

Collected by Muslim, Ṭabarānī
muslim:1659aAbū Kāmil al-Jaḥdarī > ʿAbd al-Wāḥid / Ibn Ziyād > al-Aʿmash > Ibrāhīm al-Taymī from his father

I was beating my slave with a whip when I heard a voice behind me: Understand, Abu Masud; but I did not recognise the voice due to intense anger. He (Abu Mas'ud) reported: As he came near me (I found) that he was the Messenger of Allah ﷺ and he was saying: Bear in mind, Abu Mas'ud; bear in mind. Abu Mas'ud. He (Aba Maslad) said: threw the whip from my hand. Thereupon he (the Holy Prophet) said: Bear in mind, Abu Mas'ud; verily Allah has more dominance upon you than you have upon your slave. I (then) said: I would never beat my servant in future.  

مسلم:١٦٥٩aحَدَّثَنَا أَبُو كَامِلٍ الْجَحْدَرِيُّ حَدَّثَنَا عَبْدُ الْوَاحِدِ يَعْنِي ابْنَ زِيَادٍ حَدَّثَنَا الأَعْمَشُ عَنْ إِبْرَاهِيمَ التَّيْمِيِّ عَنْ أَبِيهِ قَالَ قَالَ

أَبُو مَسْعُودٍ الْبَدْرِيُّ كُنْتُ أَضْرِبُ غُلاَمًا لِي بِالسَّوْطِ فَسَمِعْتُ صَوْتًا مِنْ خَلْفِي اعْلَمْ أَبَا مَسْعُودٍ فَلَمْ أَفْهَمِ الصَّوْتَ مِنَ الْغَضَبِ قَالَ فَلَمَّا دَنَا مِنِّي إِذَا هُوَ رَسُولُ اللَّهِ ﷺ فَإِذَا هُوَ يَقُولُ اعْلَمْ أَبَا مَسْعُودٍ اعْلَمْ أَبَا مَسْعُودٍ قَالَ فَأَلْقَيْتُ السَّوْطَ مِنْ يَدِي فَقَالَ اعْلَمْ أَبَا مَسْعُودٍ أَنَّ اللَّهَ أَقْدَرُ عَلَيْكَ مِنْكَ عَلَى هَذَا الْغُلاَمِ قَالَ فَقُلْتُ لاَ أَضْرِبُ مَمْلُوكًا بَعْدَهُ أَبَدًا  

tabarani:14813Zakariyyā b. Ḥamdawayh al-Ṣaffār > ʿAffān > Shuʿbah And ʾAbū ʿAwānah > al-Aʿmash > Ibrāhīm al-Taymī from his father > Abū Masʿūd > Baynamā > Aḍrib Ghulām Lī Bi-al-Ssawṭ Idh

[Machine] While I was whipping a young boy, I heard a voice from behind me saying, "Know, Aba Mas'ood." I became so angry that I could not think straight until the Messenger of Allah ﷺ came close to me. When I saw him, the whip fell from my hand and he said, "Know, Aba Mas'ood, that Allah is more capable of punishing you than you are of punishing him." I said, "By the One who sent you with the truth, I will never strike a slave again."  

الطبراني:١٤٨١٣حَدَّثَنَا زَكَرِيَّا بْنُ حَمْدَوَيْهِ الصَّفَّارُ ثَنَا عَفَّانُ ثَنَا شُعْبَةُ وَأَبُو عَوَانَةَ عَنِ الْأَعْمَشِ عَنْ إِبْرَاهِيمَ التَّيْمِيِّ عَنْ أَبِيهِ عَنْ أَبِي مَسْعُودٍ قَالَ

بَيْنَمَا أَنَا أَضْرِبُ غُلَامًا لِي بِالسَّوْطِ إِذْ سَمِعْتُ صَوْتًا مِنْ خَلْفِي «اعْلَمْ أَبَا مَسْعُودٍ» فَجَعَلْتُ لَا أَعْقِلُ مِنَ الْغَضَبِ حَتَّى دَنَا مِنِّي رَسُولُ اللهِ ﷺ فَلَمَّا رَأَيْتُهُ وَقَعَ السَّوْطُ مِنْ يَدِي فَقَالَ «اعْلَمْ أَبَا مَسْعُودٍ أَنَّ اللهَ أَقْدَرُ عَلَيْكَ مِنْكَ» فَقُلْتُ وَالَّذِي بَعَثَكَ بِالْحَقِّ لَا أَضْرِبُ عَبْدًا أَبَدًا