A menstruating woman entering the Masjid

Q: I went to visit the grave of the Prophet (peace be upon him) and stayed there for twenty four hours but my period came suddenly just before I entered the Masjid (mosque) so I visited the prophet without praying anything due to my extreme desire to visit the prophet and that I would not be able to repeat this visit due to it's distance from where I live. What is the result of what I did?

A: 1- Women are not permitted to visit graves whether it is the grave of the Prophet (peace be upon him) or the grave of any other person. The Prophet (peace be upon him) cursed women who visit graves. He did not exclude his grave or the grave of any other person from this ruling. 2- The Junub (in a state of major ritual impurity) is permitted to pass through the Masjid if there is a need for it. Allah (Exalted be He) says: O you who believe! Approach not As-Salât (the prayer) when you are in a drunken state until you know (the meaning) of what you utter, nor when you are in a state of Janâba, (i.e. in a state of sexual impurity and have not yet taken a bath) except when travelling on the road (without enough water, or just passing through a mosque), till you wash your whole body. A menstruating woman and one who is in a postpartum period have the same ruling of the Junub. 3- It is sufficient for you to ask Allah to confer peace and blessings upon the Messenger (peace be upon him) at the Masjid, home, or any other place where it is permitted to mention the Name of Allah. Visiting graves for women is not legally permitted as was said in the Hadith mentioned earlier. 4- You have to seek Allah's forgiveness for what you did of entering the Masjid for the sake of visiting the grave of the Prophet (peace be upon him) while you were menstruating. (Part No. 6; Page No. 275) May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.