Shaikh Ibn Bāz (may Allah’s mercy be upon him) said: “Umar Ibn Al-Khattāb (radiyallāhu ‘anhu) allowed Salāh in a church if their was some need for the Muslims and soldiers to do so―either due to rain, or cold, or other than that. In these cases there is no harm for a need―other than this, then one should not go to them.”
Shaikh Al-Islam Ibn Taymiyyah (rahimahullāh) was asked: “Is it allowed to pray in a hermitage or in a church in which there are images? Or is it impermissible? Is it allowed to call them the houses of Allah?”
Ibn Taymiyyah responded: “They are not the houses of Allāh―the houses of Allah are the mosques. These [churches] are houses wherein there is disbelief in Allah, even if He may be mentioned in them. So houses are in accordance to its people, and the people of churches are disbelievers―they are houses where the disbelievers perform worship.
As for performing Salāh in them, then the scholars have three sayings: 1. The view of Ahmad (ibn Hanbal) and others is that it is forbidden unrestrictedly, and that is also the saying of Mālik. 2. It is allowed without restriction, and this was the saying of some of companions of Imām Ahmad. 3. That which is authentically reported from ‘Umar Ibn Al-Khattāb and others and recorded from Ahmad and others―and that is that if there are images in these places, then one is not permitted to pray in them because the angels will not enter a house wherein there is an image; and because the Prophet (salallāhu ‘alaihi wasallam) did not enter the Ka’bah until all the images inside it were removed. Also, ‘Umar (radiyallāhu ‘anhu) said: ‘We would not enter their churches whilst there are images inside them.’ These churches are like mosques that are built over graves. Bukhāri (no. 427) and Muslim (no. 528) reported that the churches of Abyssinia were mentioned to the Prophet (salallāhu ‘alaihi wasallam) and what was inside them of images and pictures. So he (salallāhu ‘alaihi wasallam) said:
إِنَّ أُولَئِكِ إِذَا كَانَ فِيهِمُ الرَّجُلُ الصَّالِحُ فَمَاتَ بَنَوْا عَلَى قَبْرِهِ مَسْجِدًا وَصَوَّرُوا فِيهِ تِلْكَ الصُّوَرَ أُولَئِكِ شِرَارُ الْخَلْقِ عِنْدَ اللَّهِ يَوْمَ الْقِيَامَةِ
‘When a pious person amongst them used to die, they would build a place of worship over his grave, and then decorate it with these pictures. They shall be the worst of creatures on the Day of Judgment in the sight of Allah.’
And, if there were no images in a church, then the Sahābah would pray in it―and Allah knows best.”
(Al-Fatāwā Al-Kubrā, 2/59)
So, prayer in a church is allowed if there is a need for that. However, if someone prays in a place where he finds an image, then the prayer is valid, though he is sinful for praying there (unless he was compelled).
Al-Lajnah Ad-Dā’imah, the Permanent Committee of Scholars, was asked: “What is the ruling of prayer in a room which has in it pictures or statues of animals and humans for the purpose of decoration.” They answered: “It is prohibited to acquire images and statues and place them in the homes due to the saying of the Prophet (salallāhu ‘alaihi wasallam) to ‘Alī (radiyallāhu ‘anhu), ‘Do not pass by an image except that you deface it, nor a raised grave except that you level it.’ And due to his saying, ‘The angels will not enter a home wherein there is a dog or a picture.’ And it is disliked to pray in a room where there is a picture hanging or displayed especially if it is in the direction of the Qiblah of the worshipper―though the prayer is valid. And guidance lies with Allah―and may the peace and blessings of Allah be upon the our Prophet Muhammad, his family and his Companions.”
(Source: Fatawa Al-Lajnah Ad-Dā’imah Lil-Buhooth Al-‘Ilmiyyah wal-Iftā, 5/377, Ibn Baz, Abdullah Ghudayān, Sālih Al-Fawzān, Abdul-Azeez Aalush-Shaikh, Abdur-Razzāq ‘Afeefi and Bakr Abu Zayd)
Furthermore, it is not permitted to pray in a church that is built over a grave, just as it is not permissible to pray in a mosque that is built over a grave.
If a person has to pray somewhere and can only find a room where there are pictures or statues of humans or animals, then they should be covered up before praying, otherwise he should leave and pray elsewhere.
Abu Khadeejah Abdul-Wāhid.