Praying over the deceased in the mosque
Is it permissible to pray over the deceased in the mosque? And if the deceased is taken into the mosque after the Noon Prayer, the Sunset Prayer or Nightfall Prayer, which is to be prayed first, the sunna prayers associated with the obligatory prayers or the funeral prayer?
Obligatory measures concerning the deceased
1. Washing the deceased
2. Shrouding the deceased
3. Praying over the deceased
4. The burial
The Funeral prayer
The funeral prayer is a communal obligation, and the conditions necessary for the validity of the prescribed prayers and others are applicable to the funeral Prayer. These include purity of body, clothes and place of prayer; covering one's awrah [those parts of the body which are required to be covered in Islam]; facing the direction of prayer and standing when one is able to.
Where it is performed
It is permissible to pray the funeral prayer in the mosque or any other place which is pure, but not unlawful to pray in. The Prophet [pbuh] prayed the funeral prayer in the mosque as well as in the musalla (an area in the desert where the prayers of the two 'Eids were prayed). 'Abad ibn 'Abdullah ibn al-Zubayr narrated that 'A`isha ordered that the body of Sa'd to be brought to her. So the funeral procession passed through the mosque [to reach her house] and she made supplications for him. As she was criticized for this, she said: "How quick people come to conclusions! The Messenger of Allah [pbuh] prayed over ibn Bayda` in the mosque" [Muslim, abu Dawud al-Tirmidhi and others]. Ibn 'Umar, may Allah be pleased with them both, narrated that 'Umar, may Allah be pleased with him, prayed over Sa'd in the mosque as did Suhaib.
Scholars who maintain that the funeral prayer is to be prayed in the musalla follow the apparent meaning of textual evidences. However, Shafi'i scholars explained that the Prophet prayed the funeral prayer in the musalla because the mosque could not accommodate all those who attended the funeral prayers. Based on this, Shafi'i scholars recommended that funeral prayers be held in the mosque due to the virtue of the place and because it can accommodate the attendees.
Praying the funeral prayer after the prescribed prayer
If the deceased is taken into the mosque after the prescribed prayers, the funeral prayer is to be performed before the supererogatory prayer since it is a duty to hasten burial. Abbu Huraira, may Allah be pleased with him, narrated that the Prophet [pbuh] said: " Make haste with the funeral rites for if the deceased was righteous, you will be forwarding it to welfare and if it was otherwise, you will be relieved of an evil placed on your shoulders" [Bukhari, Muslim, abu Dawud, Ahmed, al-Hakim, al-Tirmidhi].
• It is recommended to hasten all the affairs concerning a deceased
• It is legally permissible to pray funeral prayers in mosques
• A person may pray the funeral prayer, the supererogatory prayer associated with the obligatory prayer alone while the funeral prayer is being held in the mosque, exit the mosque or sit in the mosque without participating in the funeral prayer since it is a communal obligation.
• The funeral prayer is not to be postponed due to a supererogatory prayer associated with the obligatory prayer since one does not conflict with the other.
Allah Almighty knows best.