Sunan Ibn Majah, Hadith 2348

It was narrated that Zaid bin Arqam said: “A case was brought to 'Ali bin Abu Talib when he was in Yemen, concerning three men who had intercourse with a woman during one period of being free from menses. He asked two of them: “Do you affirm that this child belongs to (the third man)?” And they said: “No.” He asked another two of them: “Do you affirm that this child belongs to (the third man)?” And they said: “No.” Every time he asked two of them whether they affirmed that the child belonged to the third, they would say no. So he cast lots between them, and attributed the child to the one whose name was chosen in this manner, and obliged him to pay two thirds of the Diyah. The Prophet was told of this, and he smiled so broadly that his back teeth became visible.

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

sunnah.com