There was a man called Marthad bin Abu Marthad who used to smuggle prisoners out of Mecca and bring them to Medina. There was a prostitute in Mecca named Anaq who had been a friend of his. He had promised one of the prisoners of Mecca that he would carry him out.Marthad said, "I came and reached the shade of one of the walls of Mecca on a moonlit night. Anaq came along and saw the dark outline of my shadow beside the wall. When she reached me, she recognized me and said, 'Marthad?'I said, 'Marthad.'She said, 'Welcome! Come, spend the night with us.'I said, 'Allah has forbidden fornication.'She cried out, 'People of the tents! This man is the one carrying off your prisoners!'Eight men pursued me. I took the road of Khandama and reached a cave, or a cavern, and entered it. They came and stood right above me and urinated, and their urine fell upon my head, but Allah blinded them to me. Then they turned back, and I returned to my companion and carried him. He was a heavy man. When I reached the place of the idhkhir grass, I undid his shackles and began carrying him while he helped me along, until I arrived in Medina.I came to the Messenger of Allah ﷺ and said, 'Messenger of Allah, shall I marry Anaq?'The Messenger of Allah ﷺ remained silent and gave me no reply, until the verse was revealed, "The fornicator does not marry except a fornicatress or a polytheist, and none marries the fornicatress except a fornicator or a polytheist, and that has been forbidden to the believers" [Nur 24:3].Then the Messenger of Allah ﷺ said, 'Marthad, the fornicator does not marry except a fornicatress or a polytheist, and none marries the fornicatress except a fornicator or a polytheist, so do not marry her.'"
كان رجل يقال له مرثد بن أبي مرثد، وكان رجلا يحمل الأسرى من مكة حتى يأتي بهم المدينة، قال: وكانت امرأة بغي بمكة، يقال لها: عناق، وكانت صديقة له، وإنه كان وعد رجلا من أسارى مكة يحمله، قال: فجئت حتى انتهيت إلى ظل حائط من حوائط مكة في ليلة مقمرة. قال: فجاءت عناق، فأبصرت سواد ظلي بجنب الحائط، فلما انتهت إلى عرفته، فقالت: مرثد؟ فقلت: مرثد، فقالت: مرحبا وأهلا، هلم! فبت عندنا الليلة. قال: قلت: حرم الله الزنا. قالت: يا أهل الخيام! هذا الرجل يحمل أسراكم. قال: فتبعني ثمانية، وسلكت الخندمة فانتهيت إلى كهف أو غار، فدخلت، فجاؤوا حتى قاموا على رأسي، فبالوا، فظل بولهم على رأسي، وأعماهم الله عني، قال: ثم رجعوا، ورجعت إلى صاحبي، فحملته، وكان رجلاثقيلا حتى انتهيت إلى الإذخر، ففككت عنه أكبله، فجعلت أحمله، ويعينني حتى قدمت المدينة، فأتيت رسول الله ﷺ، فقلت: يا رسول الله أنكح عناقا؟ فأمسك رسول الله ﷺ، فلم يرد علي شيئا حتى نزلت: {الزان لا ينكح إلا زانية أو مشركة والزانية لا ينكحها إلا زان أو مشرك وحرم ذلك على المؤمنين}، فقال رسول الله ﷺ: يا مرثد! الزاني لا ينكح إلا زانية أو مشركة، والزانية لا ينكحها إلا زان أو مشرك، فلا تنكحها.
Reported by Abu Dawud (2051), Tirmidhi (3177) with this wording, Nasai (3228), and Hakim (2/166), all through the route of Ubaydullah bin Akhnas, who said, Amr bin Shuayb told me, from his father, from his grandfather, who said, then he mentioned it.Its isnad is hasan because of Amr bin Shuayb, for his hadith is hasan.