Sahih Muslim Book 27, Hadith 46
I have caused you pain. He said: No. But he (Ibn Umar) said: You are free. He then took hold of something from the earth and said: There is no reward for me even to the weight equal to it. I heard Allah's Messenger (ﷺ) as saying: He who beats a slave without cognizable offence of his or slaps him (without any serious fault), then expiation for it is that he should set him free.
I came to Ibn 'Umar as he had granted freedom to a stave. He (the narrator further) said: He took hold of a wood or something like it from the earth and said: It (freedom of a slave) has not the reward evert equal to it, but the fact that I heard Allah's Messenger (way peace be upon him) say: He who slaps his slave or beats him, the expiation for it is that he should set him free.
This hadith has been narrated through another chain of transmitters with a slight variation of words.