The Messenger of Allah ﷺ said, "The child belongs to the bed, and the adulterer gets the stone."
حدثنا أحمد بن منيع حدثنا سفيان عن الزهري عن سعيد بن المسيب
قال رسول الله ﷺ الولد للفراش وللعاهر الحجر
Source reference, Muslim also transmitted it, in the chapter on Suckling, "The child belongs to the marriage bed, and avoiding doubtful matters," no. 1458, from the hadith of Sufyan bin Uyayna with the same wording. The hadith has other chains in Bukhari, no. 6818, and elsewhere.On this subject there are also hadiths from Umar [Ibn Majah, no. 2005], Uthman [Abu Dawud, no. 2275], Ayesha [Bukhari, no. 2421, and Muslim, no. 1457], Abu Umama [Ibn Majah, no. 2007], Amr bin Kharija [forthcoming, no. 2121], Abdullah bin Amr [Abu Dawud, no. 2274], Bara bin Azib [Tabarani in Kabir, 5/191, no. 5057], and Zayd bin Arqam [Kabir, 1/1917, no. 5057]. Tabarani in Kabir, 5/191.