Abu Hurairah reported,

The Prophet ﷺ said, "Two women went out with their two sons. A wolf seized one of the boys, and the women disputed over the surviving child before Dawud the Prophet ﷺ, who ruled that the boy belonged to the elder of the two.They then passed by Sulayman عليه السلام, who asked, 'How did he judge between you?'She said, 'He awarded the boy to the elder.'Sulayman said, 'Bring me a knife so I may cut him in two, half for this one and half for this one.'The elder woman said, 'Yes, cut him.'But the younger said, 'Do not cut him. He is her son.'So he ruled that the child belonged to the one who refused to have him cut."

Nasai 5406

Sahih

أخبرنا المغيرة بن عبد الرحمن قال حدثنا مسكين بن بكير قال حدثنا شعيب بن أبي حمزة عن أبي الزناد عن الأعرج

عن أبي هريرة

عن النبي ﷺ قال خرجت امرأتان معهما ولداهما فأخذ الذئب أحدهما فاختصمتا في الولد إلى داود النبي ﷺ فقضى به للكبرى منهما فمرتا على سليمان عليه السلام فقال كيف قضى بينكما قالت قضى به للكبرى قال سليمان أقطعه بنصفين لهذه نصف ولهذه نصف قالت الكبرى نعم اقطعوه فقالت الصغرى لا تقطعه هو ولدها فقضى به للتي أبت أن يقطعه

النسائي 5406صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Etiquette of judges
Chapter
Annulment by a judge of rulings issued by another judge of equal or higher rank
Numbering
Darussalam 5406
Nasai 5406