The Messenger of Allah ﷺ said, "The flogged fornicator shall not marry except one like himself."
قال رسول الله ﷺ: لا ينكح الزاني المجلود إلا مثله.
Abu Dawud (2052), Ahmad (8300), Hakim (2/166), and from him Bayhaqi (7/156) all narrated it, all of them through the hadith of Abdul-Warith, from Habib al-Muallim, from Amr bin Shuayb, from Saeed bin Abu Saeed Maqburi, from Abu Hurairah, who mentioned it. Its isnad is hasan because of Amr bin Shuayb, for his hadith is hasan.Hakim said, "Its isnad is sahih."Imam Ahmad said, the marriage contract of a chaste man to a promiscuous woman is not valid as long as she remains in that state, until she is asked to repent. If she repents, the contract with her becomes valid, otherwise it does not.Likewise, the marriage of a free, chaste woman to a sinful, fornicating man is not valid until he makes a sincere repentance. That is because of the words of Allah, Most High, "and that is forbidden to the believers" [Nur 24:3], as mentioned by Ibn Kathir in his tafsir.The discussion on this matter is elaborated in detail in the chapter on marriage.