The Messenger of Allah ﷺ said, "Two women went out, each with her child. A wolf attacked one of them and carried off her son. The two then began disputing over the remaining child, and they brought their case to Dawud , who ruled that the child belonged to the elder of the two.They then passed by Sulayman, who asked, 'What is your situation?'They told him the story.He said, 'Bring me a knife, and I will cut the boy in half between you.'The younger woman said, 'Would you really cut him?'He replied, 'Yes.'She said, 'Do not do it. My share of him is hers.'He said, 'He is your son,' and ruled that the child belonged to her."
أخبرنا الربيع بن سليمان قال حدثنا شعيب بن الليث قال حدثنا الليث عن ابن عجلان عن أبي الزناد عن الأعرج
عن رسول الله ﷺ أنه قال خرجت امرأتان معهما صبيان لهما فعدا الذئب على إحداهما فأخذ ولدها فأصبحتا تختصمان في الصبي الباقي إلى داود عليه السلام فقضى به للكبرى منهما فمرتا على سليمان فقال كيف أمركما فقصتا عليه فقال ائتوني بالسكين أشق الغلام بينهما فقالت الصغرى أتشقه قال نعم فقالت لا تفعل حظي منه لها قال هو ابنك فقضى به لها
Muslim transmitted it in the Book of Judgments, chapter on the disagreement of jurists exercising independent judgment, hadith no. 1720, from the hadith of Muhammad bin Ajlan through the same chain, and it is also found in Al-Kubra, hadith no. 5958.