Her name is Hannah, her husband’s name Is Imraan who is the father of Maryam.When she fell pregnant, she took a vow that when she gives birth to the child she will keep him free for the service of the Musjid.That is she will not allow him to get involved in any worldly activity. She was under the impression that she will give birth to a boy because only a boy can be of service to the Musjid.At that time, vows of this nature were permissible. When the time of delivery came for the child she gave birth to a girl. Out of sadness she said” O Allah I have given birth to a girl”. She was informed that this girl will be better than boys and that Allah has accepted her. She kept the name of this child Maryam and made a Dua to Allah that Allah should protect her progeny from shaytan.Rasulullah Sallallāhu Alayhi Wasallam said that shaytan torments every child that is born. However he was unable to torment Hadhrat Maryam and Hadhrat Isa.
The lesson to be derived from this story:
Look at the blessings of her pure intentions in that Allah blessed her with a pious child and accepted her Dua’s as well. Keep your intentions pure all the time. If you do any good act, do it for Allah alone. In this way you will also be valued by Allah.
Reference: Bahishti Zewar