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.
Sahih Muslim Book 27, Hadith 56