Narrated Abu Huraira
A man came to Allah's Messenger (ﷺ) while he was in the mosque, and called him, saying, "O Allah's Apostle! I have committed illegal sexual intercourse." The Prophet (ﷺ) turned his face to the other side, but when the man gave four witnesses against himself, the Prophet (ﷺ) said to him, "Are you mad?" The man said, "No." So the Prophet (ﷺ) said (to his companions), "Take him away and stone him to death. "