Sayyiduna Abu Mas'ud (may Allah be pleased with him) says: I was beating my slave with a whip when I heard a voice behind me: "Abu Mas'ud! Know." Because of anger I did not recognise the voice. Then the same voice came again. When he came near, I saw that it was the Prophet (peace and blessings be upon him), and he was saying: "O Abu Mas'ud! Allah has more power over you than you have over your slave." He says: I threw the whip from my hand and said: After today I will never beat my slave.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النفقات / 15794