Abu Hurairah reported,

When I came to the Prophet ﷺ, I said along the road,"What a night, with its length and hardship, Yet it brought escape from the land of disbelief."A slave of mine had run away from me on the road. When I reached the Prophet ﷺ, I pledged allegiance to him. While I was with him, the slave appeared. The Messenger of Allah ﷺ said to me, "Abu Hurayrah, here is your slave."I said, "He is free for the sake of Allah," and I freed him.Abu Abdullah said, Abu Kurayb did not include the word "free" in his narration from Abu Usama.

Bukhari 2531

Sahih

حدثنا عبيد الله بن سعيد حدثنا أبو أسامة حدثنا إسماعيل عن قيس

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

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

البخاري 2531صحيح
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 2531
Bukhari 2531