(50) باب الْقُرْعَةِ فِي الْوَلَدِ إِذَا تَنَازَعُوا فِيهِ وَذِكْرِ الاِخْتِلاَفِ عَلَى الشَّعْبِيِّ فِيهِ فِي حَدِيثِ زَيْدِ بْنِ أَرْقَمَ
It was narrated that Zaid bin Arqam said:
"Three men were brought to 'Ali while he was in Yemen; they all had intercourse with a woman during a single menstrual cycle. 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.' So he cast lots between them, and attributed the child to the one whom the lot fell, and obliged him to pay two-thirds of the Diyah. The Prophet was told of this, and he laughed so much that his back teeth became visible."
Reference: Sunan an-Nasa'i 3488
In-book reference: Book 27, Hadith 100
English translation: Vol. 4, Book 27, Hadith 3518