Short answer
The prayer is valid if the spot is clean, but the Hanafi school dislikes entering a church or synagogue without a need and dislikes praying there, especially facing statues or pictures. If you are there for a real reason when the prayer time comes, such as a funeral, a meeting or travel, pray in a clean corner away from images.
Prayer in a church or synagogue is valid but makruh, more so with images or statues in front of you. Entering one without a need is disliked. If the time of prayer comes and there is no better place, pray in a clean spot with no images ahead of you rather than let the time pass.
Other madhhabs
- Hanbali
- Praying in a church or synagogue is permitted, though disliked where there are images.
- Shafi'i
- The prayer is valid; entering a place of worship that contains images is disliked, and some Shafi'i scholars forbid it.
- Maliki
- Praying in a church is disliked, though the prayer is valid.
Explanation
The whole earth was made a place of prayer for this community, so a prayer offered in a church or synagogue on a clean spot is valid. The question is whether it is disliked. The Hanafi scholars say it is, for two reasons: these are places set up for another form of worship, and they often contain statues and pictures. When the Prophet's wives described a church they had seen in Abyssinia with images in it, he spoke strongly against making images of righteous people in places of worship.
So do not go into one to pray when a better place is available. But if you are there for a legitimate reason and the time is running out, pray: a disliked place is better than a missed prayer.
- Choose a spot without a cross, statue or picture in front of you.
- Funerals and weddings: if you truly have to attend, stay apart from their worship and do not join in it, and ask a local scholar about your case; on making du'a for them, see can you pray for non-Muslims.
- Multi-faith rooms at airports, hospitals and campuses are neutral spaces and fine to use.
- Former churches bought and used as masjids, with images removed, are masjids like any other.
Read more in can Muslims pray anywhere and Islam and Christianity.
The evidence
Sahih al-Bukhari 335
Sahih... وجعلت لي الأرض مسجدا وطهورا ...
"The earth has been made for me a place of prayer and a means of purification."
Prayer on any clean spot is valid.
Sahih al-Bukhari 427
Sahih... بنوا على قبره مسجدا وصوروا فيه تلك الصور ...
"They built a place of worship over his grave and made those images in it."
The Prophet ﷺ condemned images in places of worship, a reason these places are disliked for prayer.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, chapter on what is disliked in prayer. Discusses the dislike of entering and praying in churches and synagogues, especially with images.
- al-Mughni (Ibn Qudama), Chapter on places of prayer. The Hanbali school permits praying in a church, disliking it where there are images.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.