Abu Hurairah reported,

When he was on his way intending to embrace Islam, he had his servant boy with him, and the two became separated from each other. He then arrived later while Abu Hurairah was sitting with the Prophet ﷺ.The Prophet ﷺ said, "Abu Hurairah, here is your servant boy who has come to you."He replied, "I call you to witness that he is free."This was when he was reciting, "What a long and exhausting night, yet it brought deliverance from the abode of disbelief."

Bukhari 2530

Sahih

حدثنا محمد بن عبد الله بن نمير عن محمد بن بشر عن إسماعيل عن قيس

عن أبي هريرة رضي الله عنه

أنه لما أقبل يريد الإسلام ومعه غلامه ضل كل واحد منهما من صاحبه فأقبل بعد ذلك وأبو هريرة جالس مع النبي ﷺ فقال النبي ﷺ يا أبا هريرة هذا غلامك قد أتاك فقال أما إني أشهدك أنه حر قال فهو حين يقول يا ليلة من طولها وعنائها على أنها من دارة الكفر نجت

البخاري 2530صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Emancipation of slaves
Chapter
If a man says of his slave "He is for Allah" and intends manumission, and witnessing in manumission
Numbering
Darussalam 2530
Bukhari 2530