Sayyiduna Ka'b bin Malik (may Allah be pleased with him) narrated: A slave girl of mine was grazing my sheep, and a wolf ate one of the sheep. I struck the slave girl on the face, then I felt remorse. So I came to the Messenger of Allah (peace and blessings be upon him) and said: O Messenger of Allah! If I knew that this slave girl was a believer, I would set her free. The Messenger of Allah (peace and blessings be upon him) asked the slave girl: "Who am I?" She said: The Messenger of Allah. He (peace and blessings be upon him) asked: "Then who is Allah?" She said: The One who is in the heaven. The Messenger of Allah (peace and blessings be upon him) said: "Set her free, for she is a believer."
Hadith Referenceالمعجم الكبير للطبراني / باب الكاف / 16243