A man from Hadramawt narrates from Sayyiduna Zayd bin Arqam (may Allah be pleased with him) that Sayyiduna Ali (may Allah be pleased with him) was in Yemen when three men came to him disputing over a child, each claiming that he was his son. He took two of them aside and asked: "Are you willing at heart to leave the child to this (third) one?" They said: "No." Then he took two aside and asked them the same, and they too said: "No." So he said: "I see that you are quarrelling partners, and I will cast lots between you." So he cast lots between them and assigned the child to the one whose lot came out, and imposed on him a penalty of two-thirds of the blood money (diyah) for the other two.
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 4970