Yusuf reported,

I was whipping a slave boy of mine when I heard a voice behind me saying, "Know, Abu Masud!" I could not make out the voice clearly because of my anger.When the speaker drew near, I saw that it was the Messenger of Allah ﷺ, and he was saying, "Know, Abu Masud! Know, Abu Masud!"I dropped the whip from my hand.He said, "Know, Abu Masud, that Allah has more power over you than you have over this boy."I said, "I will never strike a slave again after this."

Muslim 4306

Sahih

حدثنا أبو كامل الجحدري حدثنا عبد الواحد يعني ابن زياد حدثنا الأعمش

عن إبراهيم التيمي عن أبيه قال قال أبو مسعود البدري

كنت أضرب غلاما لي بالسوط فسمعت صوتا من خلفي اعلم أبا مسعود فلم أفهم الصوت من الغضب قال فلما دنا مني إذا هو رسول الله ﷺ فإذا هو يقول اعلم أبا مسعود اعلم أبا مسعود قال فألقيت السوط من يدي فقال اعلم أبا مسعود أن الله أقدر عليك منك على هذا الغلام قال فقلت لا أضرب مملوكا بعده أبدا

مسلم 4306صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Oaths
Chapter
Companionship with slaves and expiation for one who slaps his slave
Numbering
Darussalam 4306
Muslim 4306