Sahih Muslim , Hadith 1441

Abu Darda' (Allah be pleased with him) related from the Prophet of Allah that he came upon a woman who was in the advanced stage of pregnancy at the door of a tent. He (the Holy Prophet) said: Perhaps he (the man accompanying her) intends to cohabit with her. They said: Yes. Thereupon Allah's Messenger said: I have decided to curse him with such a curse as may go along with him to his grave. How can he own him (the child to be born) and that is not lawful for him, and how can he take him as a servant for that is not lawful for him?

وَحَدَّثَنِي مُحَمَّدُ بْنُ الْمُثَنَّى، حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، عَنْ يَزِيدَ بْنِ خُمَيْرٍ، قَالَ سَمِعْتُ عَبْدَ الرَّحْمَنِ بْنَ جُبَيْرٍ، يُحَدِّثُ عَنْ أَبِيهِ، عَنْ أَبِي الدَّرْدَاءِ، عَنِ النَّبِيِّ صلى الله عليه وسلم أَنَّهُ أَتَى بِامْرَأَةٍ مُجِحٍّ عَلَى بَابِ فُسْطَاطٍ فَقَالَ ‏"‏ لَعَلَّهُ يُرِيدُ أَنْ يُلِمَّ بِهَا ‏"‏ ‏.‏ فَقَالُوا نَعَمْ ‏.‏ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ لَقَدْ هَمَمْتُ أَنْ أَلْعَنَهُ لَعْنًا يَدْخُلُ مَعَهُ قَبْرَهُ كَيْفَ يُوَرِّثُهُ وَهُوَ لاَ يَحِلُّ لَهُ كَيْفَ يَسْتَخْدِمُهُ وَهُوَ لاَ يَحِلُّ لَهُ ‏"‏ ‏.‏

sunnah.com

A hadith like this has been transmitted on the authority of Shu'ba.

وَحَدَّثَنَاهُ أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ، ح وَحَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا أَبُو دَاوُدَ، جَمِيعًا عَنْ شُعْبَةَ، فِي هَذَا الإِسْنَادِ ‏.‏

sunnah.com