Masʿūd, Abū Hurayrah, and the Prophet’s wives—apart from ʿĀʾishah.
The same position was adopted by al-Shaʿbī, Ibn Shubruma, al-Awzāʿī, Abū Yūsuf, Muḥammad ibn al-Ḥasan, and Abū Thawr.
Their evidence is the Almighty’s statement: “Mothers shall breastfeed their children for two complete years—for those who wish to complete the term of suckling” (2:233); together with the report found in both Ṣaḥīḥ collections from ʿĀʾishah in which the Prophet ﷺ said, “Breastfeeding that establishes the prohibition is only that which satisfies hunger.” They also cite the ḥadīth of Umm Salamah, in which the Prophet ﷺ said, “No breastfeeding renders anything unlawful except what opens the intestines and occurs before weaning” (reported by al-Tirmidhī).
Imām Abū Ḥanīfah, however, held that the breastfeeding which brings about the marital prohibition is that which takes place within thirty months. His proof is the verse: “His bearing and his weaning are thirty months” (46:15). He argued that the word ḥaml (bearing) here cannot refer to carrying the child in the womb, for pregnancy may last two full years; rather, it must refer to the period of carrying the infant during suckling, and thus the total time allowed for nursing is thirty months.
In one narration from Imām Mālik it is related that breastfeeding which occurs one, two, or three months beyond the two-year mark is still treated as part of those two years, while anything after that is of no consequence.
Shaykh al-Islām Ibn Taymiyyah said: “Maḥram status through breastfeeding remains in effect until weaning—whether that occurs before the completion of two years or after them. The Lawgiver has linked the ruling to weaning itself, regardless of when it takes place.” This is a sound opinion with considerable merit.