Before Entering: The Preparation
Purity: Entering the mosque while in a state of major impurity (janaba, requiring ghusl) is forbidden for most scholars: “O you who have believed, do not approach prayer while you are intoxicated until you know what you are saying or in a state of janabah, unless passing through [a place of prayer], until you have washed.” (4:43) The mosque is a place of prayer; those in major impurity should not linger.
For minor impurity (requiring wudu): Scholars differ — entering without wudu to pass through or retrieve something is permitted by most schools; sitting and remaining in the mosque without wudu is disliked.
The miswaak (teeth-cleaning stick): The Prophet (SAW) said: “Were it not for the hardship on my Ummah, I would have commanded them to use the miswaak before every prayer.” (Bukhari) Cleaning the teeth before prayer, and especially before entering the mosque, is a emphasized Sunnah.
Removal of anything offensive: The Prophet (SAW) said: “Whoever eats garlic or onion should keep away from us and from our mosque.” (Bukhari) — Extending the principle: anything with a strong offensive smell (certain foods, poor hygiene, strong cologne that would disturb others in a tight space) should be addressed before entering the mosque.
Upon Entering
Which foot first: Enter with the right foot — as with entering all places of good.
The du’a upon entering: “Bismillah wal-salatu wal-salamu ‘ala Rasulillah. Allahumma iftah li abwab rahmatik.” (“In the name of Allah, and peace and blessings upon the Messenger of Allah. O Allah, open for me the gates of Your mercy.”)
Tahiyyat al-Masjid (Greeting the Mosque Prayer): The Prophet (SAW) said: “If one of you enters the mosque, let him not sit down until he has prayed two rak’at.” (Bukhari, Muslim) This two-rak’a prayer (called tahiyyat al-masjid — “greeting of the mosque”) is a Sunnah mu’akkada (emphasized Sunnah) performed before sitting. It is performed even if one enters during a sermon (Jumu’a khutbah), though briefly.
Conduct Inside the Mosque
Face the qiblah when possible: Though casual conversation and sitting sideways are permitted, orienting oneself toward the qiblah when sitting reflects consciousness of the space.
Maintain stillness and quietness: The mosque is a place of sukina (tranquility). Loud conversation, arguments, or raised voices are disliked.
What is specifically prohibited or strongly disliked:
- Buying and selling transactions (bay’ wa shira’): The Prophet (SAW) said: “If you see someone buying and selling in the mosque, say: ‘May Allah not make your trade profitable.’” (Tirmidhi) — Commercial transactions do not belong in the space of worship
- Announcing lost items (nash al-dallin): The Prophet (SAW) prohibited announcing lost items in the mosque in the way of a public market call
- Raising voices unnecessarily: The Prophet (SAW) heard someone raising his voice in the mosque and said, “The mosques were not built for this.”
- Spitting inside or toward the qiblah: The Prophet (SAW) called this disrespect (Bukhari)
- Stepping over people during prayer or rows: Walking in front of a person in prayer is prohibited — the Prophet (SAW) said: “If the one who passes in front of a worshipper knew what [sin] he incurred, he would rather wait 40 [days/years] than pass in front of him.” (Bukhari, Muslim)
What is permitted:
- Sleeping briefly in the mosque (the Companions would sometimes rest in the mosque)
- Eating and drinking (modestly, not creating mess)
- Discussing knowledge and religious matters
- Community consultation (shura)
Exit Etiquette
Which foot first: Exit with the left foot.
The du’a upon leaving: “Bismillah wal-salatu wal-salamu ‘ala Rasulillah. Allahumma inni as’aluka min fadlik.” (“In the name of Allah, and peace and blessings upon the Messenger of Allah. O Allah, I ask You from Your bounty.”)
The change from “open the gates of mercy” (entering) to “I ask from Your bounty” (leaving) reflects the journey: entering the mosque for mercy and spiritual renewal; leaving it, returning to the world seeking its provisions from Allah.
The Prophet’s Mosque in Medina
The Prophet (SAW) built the first mosque of the Islamic state in Medina upon his arrival from the Hijra. He participated physically in its construction: carrying bricks alongside the Companions, and saying: “O Allah, there is no good except the good of the Hereafter; forgive the Ansar and Muhajirin.” The mosque served simultaneously as a place of prayer, the Prophet’s residence, a gathering point for community affairs, a school, and a hospice for the poor (ahl al-suffa).
The Masjid al-Haram in Mecca and the Masjid al-Nabawi in Medina have special status: prayer in the Haram is worth 100,000 ordinary prayers; prayer in the Masjid al-Nabawi is worth 1,000; prayer in Masjid al-Aqsa is worth 500. The third mosque of special status is Masjid al-Aqsa in Jerusalem.
See also: Understanding Namaz, Wudu, Friday Prayer, Qiblah, Post Namaz Routine, Ghusl