Sahih al-Bukhari Book 86, Hadith 52
When Ma'iz bin Malik came to the Prophet (in order to confess), the Prophet (ﷺ) said to him, "Probably
you have only kissed (the lady), or winked, or looked at her?" He said, "No, O Allah's Messenger (ﷺ)!" The
Prophet said, using no euphemism, "Did you have sexual intercourse with her?" The narrator added:
At that, (i.e. after his confession) the Prophet (ﷺ) ordered that he be stoned (to death).
While I was with the Prophet (ﷺ) a man came and said, "O Allah's Messenger (ﷺ)! I have committed a legally punishable sin; please inflict the legal punishment on me'.' The Prophet (ﷺ) did not ask him what he had done. Then the time for the prayer became due and the man offered prayer along with the Prophet (ﷺ) , and when the Prophet (ﷺ) had finished his prayer, the man again got up and said, "O Allah's Messenger (ﷺ)! I have committed a legally punishable sin; please inflict the punishment on me according to Allah's Laws." The Prophet (ﷺ) said, "Haven't you prayed with us?' He said, "Yes." The Prophet (ﷺ) said, "Allah has forgiven your sin." or said, "....your legally punishable sin."
A man from among the people, came to Allah's Messenger (ﷺ) while Allah's Messenger (ﷺ) was sitting in the mosque, and addressed him, saying, "O Allah's Messenger (ﷺ)! I have committed an illegal sexual intercourse." The Prophet (ﷺ) turned his face away from him. The man came to that side to which the Prophet had turned his face, and said, "O Allah's Messenger (ﷺ)! I have committed an illegal intercourse." The Prophet (ﷺ) turned his face to the other side, and the man came to that side, and when he confessed four times, the Prophet (ﷺ) called him and said, "Are you mad?" He said, "No, O Allah's Messenger (ﷺ)!" The Prophet said, "Are you married?" He said, "Yes, O Allah's Messenger (ﷺ)." The Prophet (ﷺ) said (to the people), "Take him away and stone him to death." Ibn Shihab added, "I was told by one who heard Jabir, that Jabir said, 'I was among those who stoned the man, and we stoned him at the Musalla (`Id praying Place), and when the stones troubled him, he jumped quickly and ran away, but we overtook him at Al-Harra and stoned him to death (there).' "