Sayyiduna Abu Mas'ud al-Ansari (may Allah be pleased with him) said: I was beating a slave of mine when I heard a voice behind me: "O Abu Mas'ud, know!" He said it three times: "Allah has more power over you than this." I looked, and it was the Prophet (peace and blessings be upon him). I said: O Messenger of Allah, this slave is now free for the sake of Allah. Then the Prophet (peace and blessings be upon him) said: "Had you not done so, the Fire of Hell would have touched you."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النفقات / 15795