Sayyiduna Umar bin al-Hakam (may Allah be pleased with him) said: I came to the Messenger of Allah (peace and blessings be upon him) and said: O Messenger of Allah! A slave girl of mine used to graze my goats. One day a goat went missing. I asked her about it, and she said: A wolf ate it. I became angry and slapped her on the face. I owe the freeing of a slave; shall I free her? He (peace and blessings be upon him) asked her: "Where is Allah?" She said: In the heaven. He (peace and blessings be upon him) asked: "Who am I?" She said: You are the Messenger of Allah. He (peace and blessings be upon him) said: "Free her."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19984