Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:28:12

And We had prevented from him ˹all˺ wet nurses before, so she said, "Shall I direct you to a household that will be responsible for him for you while they are to him ˹for his upbringing˺ sincere?"  

And We had forbidden him to ˹take to the breasts of˺ fostermothers from before, that is to say, we prevented him from taking to the breasts of any suckling mother other than his own mother. Therefore he would not accept the breasts of any of the foster-mothers brought for him. So she, his sister, said, ‘Shall I show you a household — having seen their affection for him — who will take care of him for you, by having him suckled and so on, and who will act in good faith towards him?’ (the ˹suffixed˺ pronoun in lahu has been interpreted as referring to the king, as a response to them ˹when they asked Mary how she could be sure˺). Her suggestion was accepted. So she brought his mother and he took to her breast. She explained to them that he had taken to her ˹breast˺ because of her pleasant scent and the wholesome taste of her milk. Permission was given to her to breast-feed him in her own house and so she returned with him, just as God, exalted be He, says:
القرآن:٢٨:١٢

وَحَرَّمْنَا عَلَيْهِ الْمَرَاضِعَ مِنْ قَبْلُ فَقَالَتْ هَلْ أَدُلُّكُمْ عَلَىٰ أَهْلِ بَيْتٍ يَكْفُلُونَهُ لَكُمْ وَهُمْ لَهُ نَاصِحُونَ  

{وحرمنا عليه المراضع من قبل} أي قبل رده إلى أمه أي منعناه من قبول ثدي مرضعة غير أمه فلم يقبل ثدي واحدة من المراضع المحضرة له {فقالت} أخته {هل أدلكم على أهل بيت} لما رأت حنوهم عليه {يكفلونه لكم} بالإرضاع وغيره {وهم له ناصحون} وفسرت ضمير له بالملك جواباً لهم فأجيبت فجاءت بأمه فقبل ثديها وأجابتهم عن قبوله بأنها طيبة الريح طيبة اللبن فأذن لها في إرضاعه في بيتها فرجعت به كما قال تعالى: