Sahih al-Bukhari Book 87, Hadith 17
Allah's Messenger (ﷺ) said, "The blood of a Muslim who confesses that none has the right to be worshipped
but Allah and that I am His Apostle, cannot be shed except in three cases: In Qisas for murder, a
married person who commits illegal sexual intercourse and the one who reverts from Islam (apostate)
and leaves the Muslims."
A girl wearing ornaments, went out at Medina. Somebody struck her with a stone. She was brought to the Prophet (ﷺ) while she was still alive. Allah's Messenger (ﷺ) asked her, "Did such-and-such a person strike you?" She raised her head, denying that. He asked her a second time, saying, "Did so-and-so strike you?" She raised her head, denying that. He said for the third time, "Did so-and-so strike you?" She lowered her head, agreeing. Allah's Messenger (ﷺ) then sent for the killer and killed him between two stones.
A Jew killed a girl so that he may steal her ornaments. He struck her with a stone, and she was brought to the Prophet (ﷺ) while she was still alive. The Prophet (ﷺ) asked her, "Did such-and-such person strike you?" She gestured with her head, expressing denial. He asked her for the second time, and she again gestured with her head, expressing denial. When he asked her for the third time, she beckoned, "Yes." So the Prophet (ﷺ) killed him (the Jew) with two stones.