Allah the Exalted said:
“And [remember] when the angels said, ‘Mary, surely Allah has chosen you, purified you, and chosen you above the women of all peoples.
Mary, be devoutly obedient to your Lord, prostrate yourself, and bow with those who bow.’
That is part of the tidings of the unseen which We reveal to you. You were not with them when they cast their pens to see which of them would care for Mary, nor were you with them when they disputed.
When the angels said, ‘Mary, Allah gives you glad tidings of a Word from Him whose name is the Messiah, Jesus son of Mary, honored in this world and the Hereafter and one of those brought near.
He will speak to people in the cradle and in maturity, and he will be among the righteous.’
She said, ‘My Lord, how can I have a child when no man has touched me?’ He said, ‘So it is—Allah creates whatever He wills. When He decrees a matter He only says to it, “Be,” and it is.
And He will teach him the Scripture and wisdom, the Torah and the Gospel,
And [will make him] a messenger to the Children of Israel: “I have come to you with a sign from your Lord: I will fashion for you out of clay the form of a bird, then breathe into it and it will become a bird by Allah’s permission; I will heal the blind and the leper, and revive the dead by Allah’s permission; and I will inform you of what you eat and what you store up in your houses. Surely in that is a sign for you, if you are believers.
And [I have come] confirming what was before me of the Torah and to make lawful for you some of what was forbidden to you. I have come to you with a sign from your Lord, so fear Allah and obey me.
Indeed Allah is my Lord and your Lord, so worship Him; this is a straight path.’” (Q 3:42–51)
It is mentioned that the angels brought Mary the glad tidings that Allah had selected her from among the women of the worlds of her time, choosing her to bear a child without a father, and that this child would be a noble prophet. The words, “He will speak to people in the cradle,” mean that while still an infant he would summon them to the worship of Allah alone with no partner, and likewise in adulthood—indicating that he would live to reach mature age and call people to Allah then as well. She was ordered to engage in abundant worship, devout obedience, prostration, and bowing so that she might be worthy of this honor and properly thank Allah for the blessing.
It is said that she would stand in prayer until her feet cracked—peace be upon her, and may Allah have mercy on her, her mother, and her father.
The angels’ words, “O Mary, indeed Allah has chosen you,” mean: He has singled you out and favored you; “and purified you,” that is, He cleansed you of blameworthy traits and endowed you with praiseworthy qualities; “and chosen you above the women of all peoples.” This may be understood as referring to the women of her own era, like His statement to Moses, “I have chosen you above the people” (Q 7:144), and His statement about the Children of Israel, “We chose them knowingly above all peoples” (Q 44:32). It is, however, known that Abraham, peace be upon him, is superior to Moses, and that Muhammad, peace and blessings be upon him, is superior to them both; likewise, this nation surpasses all previous nations in number, knowledge, and purity of deed.
It is also possible that the phrase “and chosen you above the women of all peoples” retains its unrestricted scope, meaning that she is the best woman in the world (1) whether before her or after her. For if she were indeed a prophetess—as maintained by those who affirm prophethood for her, for Sarah the mother of Isaac, and for the mother of Moses, citing the angels’ speech and the revelation sent to the mother of Moses, such as Ibn Ḥazm and others—then nothing prevents Mary from surpassing Sarah and the mother of Moses, given the general wording, “and chosen you above the women of all peoples,” and no text opposes it. Allah knows best.
As for the majority view—transmitted by Abū al-Ḥasan al-Ashʿarī and others from Ahl al-Sunnah wa-l-Jamāʿah—that prophethood is confined to men and that no woman has ever been a prophet, Mary’s highest rank would then be, as Allah the Exalted says: “The Messiah …"