Some captives were brought before 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 him, press him to her belly, and nurse him.The Prophet ﷺ said to us, "Do you think this woman would throw her own child into the fire?"We replied, "No, not when she is able to keep from doing so."He said, "Allah is more merciful to His servants than this woman is to her child."
قدم على النبي ﷺ سبي، فإذا امرأة من السبي قد تحلب ثديها تسقي، إذا وجدت صبيا في السبي أخذته، فألصقته ببطنها، وأرضعته، فقال لنا النبي ﷺ: أترون هذه طارحة ولدها في النار؟ قلنا: لا، وهي تقدر على أن لا تطرحه فقال: الله أرحم بعباده من هذه بولدها.
Bukhari narrated it in Adab (5999), and Muslim in Tawbah (2754), both from the hadith of Ibn Abu Maryam, who said, Abu Ghassan narrated to us, he said, Zayd bin Aslam narrated to me, from his father, from Umar bin Khattab, and he mentioned it.