Maryam bint Imran (Daughter of Imran) holds a dignified and exalted rank in Islam and She is the only woman mentioned in the Holy Quran, and She is mentioned in almost 70 verses in the Quran. ALLAH SWT mentioned her as the greatest of all women.
And as the Angels said, “O Maryam, (Mary) surely Allah has elected you and purified you and has elected you over the women of the worlds(Quran 3:42)
ALLAH SWT blessed Maryam alaihissalam with divine grace since her birth itself.
Maryam alaihissalam’s mother Hannah (wife of Imran) supplicated to ALLAH SWT to grant her a child as she was childless for a long time and was in her old age. She vowed to ALLAH that She would devote her child to worshipping ALLAH SWT only and in the service of Masjid-al-Aqsa in Jerusalem.
When the wife of Imran said,” My Lord, indeed I have pledged to you what is in my womb, consecrated (for your service), so accept this from me” (Quran 3:35)
ALLAH SWT answered her prayers and she delivered a girl and named her Maryam. Since Hannah pledged to devote her child to ALLAH SWT, she was expecting a boy thinking that boy would be stronger and appropriate for this task of serving the masjid-al-Aqsa.
But when she gave birth, she said, ‘My Lord! I have given birth to a girl’- God knew best what she had given birth to: the male is not like the female- ‘ I name her Mary and I commend her and her offspring to Your protection from the rejected Satan.’(Quran 3:36)
Her parents gave Maryam in the service of the Masjid as intended, and she grew up to be devoted and dedicated to ALLAH SWT, in the goodness of etiquette and character. ALLAH SWT made her grow under the guardianship of a Prophet, Prophet Zakariya alahissalam after the death of Imran(Her father). Zakariya alaihissalam was her mentor and teacher.
Zakariya alaihissalam built a mihrab(a room) for Maryam alaihissalam in the Masjid where she could have her privacy away from men and pray in the Masjid.
ALLAH SWT says in Quran: “And mention in the Book (the story of) Maryam, when she secluded herself from her people to a place towards East” (Quran 19:16)
Zakariya alaihissalam visited her often to check her and found her always worshiping ALLAH SWT with complete dedication even when she was very young. And whenever He visited Her, He noticed that Maryam had various provisions in Her room which He never bought for Her. There were fruits out of season and unique. When He asked Maryam, how these things got here, She used to reply that it’s from ALLAH SWT.
So her Lord (ALLAH) accepted her with goodly acceptance. He made her grow in a good manner and put her under the care of Zakariya. Every time he entered Al-Mihrab to (visit) her, he found her supplied with sustenance. He said: “O Maryam (Mary)! From where have you got this?” She said, “This is from Allah.” Verily, Allah provides sustenance to whom He wills, without limit.”(Quran 3:37)
ALLAH SWT blessed Maryam alaihissalam with favors that no one else had in her time. It was the chastity and uniqueness of Maryam alaihissalam that inspired Prophet Zakariya alaihissalam to pray with His complete trust in ALLAH SWT for a child, even though He was in His extreme old age.
This was how Her childhood and upbringing went, worshipping ALLAH SWT with complete dedication and in seclusion, away from worldly affairs.
Once, when She was alone in Her room, She found someone in the room and She got startled because, no one ever had access to her room except for Zakariya alaihissalam. She immediately sought refuge from ALLAH SWT. It was the angel Jibrail alaihissalam sent by ALLAH SWT to give her the news of Isa alaihissalam.
Then she used a barrier to hide from them. Then, We sent to her Our Spirit, (Jibrail) and he took before her the form of a perfect human being(Quran 19:17)
She said: “Indeed, I seek refuge in the Most Merciful from you, [so leave me] if you should be fearing of Allah”(Quran 19:18)
To her reaction, Jibrail alaihissalam replied: I am but a message-bearer of your Lord (sent) to give you a boy, purified.”(Quran 19:19)
Jibrail alihissalam gave her the news of Isa’s conception and She was shocked at this astounding news.
She replied: “How shall I have a boy while no human has ever touched me, nor have I ever been unchaste?”(Quran 19:20)
This was a tremendous test from ALLAH SWT for Maryam and She surrendered herself to her conception with utmost trust and faith in ALLAH’s decree.
Maryam spent most of her pregnancy time in seclusion. Months later when the labor pain approached Maryam alaihissalam, She moved to a remote vicinity in Jerusalem thinking to disappear from everyone.
So she conceived him(Isa alaihissalam) and went in seclusion with him to a remote place(Quran 19:22)
She was worried about what would happen to Her and Her family as She was going to give birth to a child. She was worried about Her chastity being judged by people. ALLAH SWT knew Her fear and guided Her to deal with society.
ALLAH SWT mentions this incident in the Quran :
“And mention, [O Muhammad], in the Book [the story of] Mary, when she withdrew from her family to a place toward the east. And she took, in seclusion from them, a screen. Then We sent to her Our Angel [i.e., Gabriel], and he represented himself to her as a well-proportioned man. She said, ‘Indeed, I seek refuge in the Most Merciful from you, [so leave me] if you should be fearing of God.’ He said, ‘I am only the messenger of your Lord to give you [news of] a pure boy [i.e., son].’ She said, ‘How can I have a boy while no man has touched me and I have not been unchaste?’ He said, “Thus [it will be]; your Lord says, ‘It is easy for Me, and We will make him a sign to the people and a mercy from Us. And it is a matter [already] decreed.’” So she conceived him, and she withdrew with him to a remote place.”(Quran 19:16–22)
When the labor pain approached and she was struggling under the shade of a palm tree, ALLAH SWT commanded her to shake the palm tree so she can have fresh ripe dates to ease her pain and provide her with energy.
ALLAH says in Quran: “And the pains of childbirth drove her to the trunk of a palm tree. She said, ‘Oh, I wish I had died before this and was in oblivion, forgotten.’ But he called her from below her, ‘Do not grieve; your Lord has provided beneath you a stream.’” (Quran 19:23-24)
“And shake toward you the trunk of the palm tree, it will drop upon you ripe, fresh dates”(Quran 19:25)
And Isa alaihissalam was born, She carried the baby and came to Her people. They started questioning and judging Her.
By the will of ALLAH SWT, baby Isa gave them an answer from the lap of His mother and defended His mother of all the accusations and also explained to people who He was.
This incident is mentioned in the Quran :
“So eat and drink and be contented. And if you see from among humanity anyone, say, ‘Indeed, I have vowed to the Most Merciful abstention, so I will not speak today to [any] man.’ Then she brought him to her people, carrying him. They said, ‘O Mary, you have certainly done a thing unprecedented. O sister of Aaron, your father was not a man of evil, nor was your mother unchaste.’ So she pointed to him. They said, ‘How can we speak to one who is in the cradle. The child said, ‘Indeed, I am the servant of God. He has given me the Scripture and made me a prophet. And He has made me blessed wherever I am and has enjoined upon me prayer and zakah as long as I remain alive And [made me] dutiful to my mother, and he has not made me a wretched tyrant. And peace is on me the day I was born and the day I will die and the day I am raised alive.’” (Quran 19:26-33)
Hence, the birth of Maryam alaihissalam and Her upbringing, and the Birth of Prophet Isa alaihissalam were miraculous and full of signs and lessons for mankind.
ALLAH SWT mentions the qualities of Maryam alaihissalam in the Quran many times. ALLAH SWT declares her to be a sign to mankind, as the one who guards her chastity, an obedient one, a chosen one, purified, truthful,exalted above all women.
It is reported from Abu Huraira Razi Allah that Muhammad SAW said, “No person is born but that he is pricked by Satan and he cries from the touch of Satan, except for Mary and her son.” Sahih Bukhari 3248 & Sahih Muslim 2366