Umar bin Khattab reported,

Some captives were brought to the Prophet ﷺ, and among them was a woman whose breasts were flowing with milk. Whenever she found a child among the captives, she would take it, hold it close to her belly, and nurse it.The Prophet ﷺ said to us, "Do you think this woman would throw her own child into the fire?"We replied, "No, not if she had the power to prevent it."He said, "Allah is more merciful to His servants than this woman is to her child."

Bukhari 5999

Sahih

حدثنا ابن أبي مريم حدثنا أبو غسان قال حدثني زيد بن أسلم عن أبيه

عن عمر بن الخطاب رضي الله عنه

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

البخاري 5999صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Manners
Chapter
Mercy toward children, kissing them, and embracing them
Numbering
Darussalam 5999
Bukhari 5999