It appears that not asserting paternity for the fornicator isn’t without exception, for this was the statement of the Messenger : “The child is for the [marital] bed, and the stone is for the adulterer.”
Understanding the circumstances of the incident wherein his statement was made is essential for identifying his intent . On the authority of ‘Â’ishah, may Allah be pleased with her, who said: “‘Utbah ibn Abi Waqqâs had willed that his brother, Sa‘d, take custody of the child born to Zam‘ah’s concubine, and ‘Utbah had said: ‘He is my son.’ When the Messenger of Allah arrived, and ‘Abd ibn Zam‘ah came with him, Sa‘d ibn Abi Waqqâs said: ‘This is my brother’s son, he assured me that this is his son.’ ‘Abd ibn Zam‘ah said: ‘O Messenger of Allah, this is my brother, the son of Zam‘ah; he was born upon his bed.’ The Messenger of Allah looked at the child born to Zam‘ah’s concubine, and found him more resembling of ‘Utbah ibn Abi Waqqâs than anyone. Thus, the Messenger of Allah said: ‘Veil yourself from him, O Sawdah,’ due to the resemblance of ‘Utbah ibn Abi Waqqâs that he noticed.” ‘Â’ishah said: “The Messenger of Allah said: ‘The child is for the [marital] bed, and the stone is for the adulterer.’”
The hadith describes a specific incident wherein two are disputing over the paternity of a child; one being the owner of the marital bed, and the other being the fornicator. There was no proof aside from the martial bed and the qareenah of resemblance, so the Messenger of Allah closed the door in the face of this grave evil spreading. Otherwise, the fornicators and the scandalous will become emboldened to claim being the fathers of children born to women that have husbands.
But if a woman does not have a husband, then what is closer to the Sunnah is attributing the child to the fornicator, and this is the view of some Mâlikis, al-Hasan, Ibn Seereen, an-Nakha‘i, Is-hâq ibn Râhooyah, Sulaymân ibn Yasâr, and the choice of Ibn Taymiyah. As well, this was viewed by the Hanafis – on the condition that he marries her.
What supports this view are several evidences, of them being:
- The hadith of ‘Ali, may Allah be pleased with him, about casting lots. In it, three individuals came to ‘Ali from Yemen disputing over a child, and the three had copulated with the same woman during a single non-menstrual period… He said: “You are adamant disputants, so I will cast lots between you. Whoever wins, the child belongs to him, and he must pay two-thirds of the blood money to his two companions.” He casted between them, and allotted him to the winner, which made the Prophet, peace and blessings be upon him, laugh until his molar teeth appeared. He did not ask them if they all copulated with her mistakenly, despite that being an extremely unlikely possibility.
- The hadith of attributing the child to Shareek ibn Sahmâ’. In it, Hilâl ibn Umayyah accused his wife of committing adultery with Shareek ibn Sahmâ’ in front of the Prophet … so the Prophet said: “Watch her; if she brings him forth with dark eyes, a wide buttocks, and full legs, then he belongs to Shareek ibn Sahmâ’.” Later, she brought him forth as described, so the Prophet said: “Were it not for what preceded from the Book of Allah, there would have been a [different] matter between her and I.” The point of reference is the Prophet attributing the child to Shareek based on resemblance, though the woman was married, but the husband denied the child. Thus, that [denial] alongside the resemblance was satisfactory to accept that he was fathered by Shareek. This hadith could also be used to prove that the child of someone who fornicated with a married woman is still attributed to him if the husband denies that child. The opposition could claim that this involves depriving the performer of li‘ân from claiming the child. One response to this is that such only takes place with a child without ancestry, for the owner of the bed has denied him. Had he claimed him, the child would have been his – even if he performed li‘ân against his mother for committing adultery.
- ‘Umar attributed the children that were born of fornication during Jâhiliyyah to whoever claimed them. Al-Bayhaqi narrated that two men claimed a child, so ‘Umar, may Allah be pleased with him, summoned the people of al-qiyâfah. They said: “He resembles both of them,” so ‘Umar, may Allah be pleased with him, said to him: “Give allegiance to whichever of them you wish.” This was authenticated by al-Bayhaqi.
- The inexistence of evidence preventing such an attribution, since we aforementioned that the hadith: “…and the stone is for the adulterer,” is specific to an incident wherein the husband did not deny the child.
- Most jurists permit attributing the child that has no known ancestry to the one who claims him, without investigating the claimant, contingent upon this being logically possible. They do not stipulate that the claimant must not have been previously married, but stipulate that he not explicitly admit fornicating.
From these evidences and others, it appears that the child born of fornication is attributed to his father if his mother was unmarried, and could be attributed to him if she had a husband but he denied the child. Understanding the evidences collectively strongly alludes to this. Preserving the rights of these children is of the goals of Shari’a.
 [Saheeh al-Bukhâri] (2/742), [Saheeh Muslim] (2/1080)
 See the choice of Shaykh al-Islâm Ibn Taymiyah in: [Majmoo‘ al-Fatâwâ] (3/176).
 [Sunan Abu Dâwud] (2/76, #2254) and was authenticated by al-Albâni. See: [Sunan Abu Dâwud] (2254) with verification by Mash-hoor.
 See: [Nihâyat al-Muhtâj] (5/108) by ar-Rumli, wherein he said: “It becomes known from the aforesaid the incorrectness of attributing a denied [child]… due to what that contains of barring the deniers right to claim him.”
 [Sunan al-Bayhaqi al-Kubrâ] (10/263)
 Shaykh Ibn ‘Uthaymeen said: “Regarding the statement of the Prophet, peace and blessings be upon him: ‘The child is for the [marital] bed, and the stone is for the adulterer,’ some scholars viewed that this was specific to disputes. In other words, if the fornicator and the owner of the bed dispute, we allot him to the owner of the bed. As for when there is no dispute with the fornicator, and the fornicator claims him, then he has the right to do so and he is attributed to him. This is the preponderant view which, upon consideration, suits both sound logic and the Sharia.” (Taken from the Shaykh’s website on the internet)
 See: [Badâ’i‘ as–Sanâ‘i’] (6/242) by al-Kâsâni, [Sharh Mukhtasar Khaleel] (6/100) by al-Kharashi, [Hâshiyat ad-Dasooqi] (3/412), and [al-Ahwâl ash-Shaksiyyah] (p. 395) by Abu Zahrah