Shuba reported,

Sulayman reported from Ibrahim Taymi, from his father, from Abu Masud that he was beating his slave boy, and the boy began saying, "I seek refuge with Allah." He kept beating him, so the boy said, "I seek refuge with the Messenger of Allah." At that he let him go.The Messenger of Allah ﷺ said, "By Allah, Allah has more power over you than you have over him."So he set him free.He did not mention the boy's words, "I seek refuge with Allah," and "I seek refuge with the Messenger of Allah ﷺ."

Muslim 4310

Sahih

و حدثنيه بشر بن خالد أخبرنا محمد يعني ابن جعفر عن شعبة بهذا الإسناد ولم يذكر قوله أعوذ بالله أعوذ برسول الله ﷺ

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