Sunan an-Nasa'i, Book 27, Hadith 102 (In-Book)

It was narrated that Zaid bin Arqam said: "I was with the Messenger of Allah, and 'Ali, may Allah be pleased with him, was in Yemen at that time. A man came to him and said: 'I saw 'Ali when three men were brought to him who all claimed (to be the father) of a child. 'Ali said to one of them: Will you give the child up to him? And he refused. He said to (the next one): Will you give the child up to him? And he refused. He said to (the next one): Will you give the child up to him? And he refused. 'Ali said: You are disputing partners. I will cast lots among you, and whoever wins the draw, the child is for him, and he has to pay two-thirds of the Diyah.' The Messenger of Allah laughed so much that his back teeth became visible."

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

sunnah.com