Narrated 'Alqamah bin Wa'il Al-Kindi:
From his father: A women went out during the time of the Prophet (ﷺ) to go to Salat, but she was caught by a man and he had relations with her, so she screamed and he left. Then a man came across her and she said: 'That man has done this and that to me', then she came across a group of Emigrants (Muhajirin) and she said: 'That man did this and that to me.' They went to get the man she thought had relations with her, and they brought him to her. She said: 'Yes, that's him.' So they brought him to the Messenger of Allah (ﷺ), and when he ordered that he be stoned, the man who had relations with her, said: 'O Messenger of Allah, I am the one who had relations with her.' So he said to her: 'Go, for Allah has forgiven you.' Then he said some nice words to the man (who was brought). And he said to the man who had relations with her: 'Stone him.' Then he said: 'He has repented a repentance that, if the inhabitants of Al-Madinah had repented with, it would have been accepted from them.'