Sahih Muslim Book 27, Hadith 56
I seek refuge with Allah, but he continued beating him, whereupon he said: I seek refuge with Allah's Messenger, and he spared him. Thereupon Allah's Messenger (ﷺ) said: By Allah, God has more dominance over you than you have over him (the slave). He said that he set him free.
When I was beating my servant, I heard a voice behind me (saying): Abu Mas'ud, bear in mind Allah has more dominance over you than you have upon him. I turned and (found him) to be Allah's Messenger (ﷺ). I said: Allah's Messenger, I set him free for the sake of Allah. Thereupon he said: Had you not done that, (the gates of) Hell would have opened for you, or the fire would have burnt you.
I seek refuge with Allah, I seek refuge with Allah's Messenger (ﷺ).