Is performing the funeral prayer (Salat al-Janazah) inside the mosque permissible?
General Chapter
Al-Mughni
Book of Funerals
Primary text
Performing the funeral prayer inside the mosque is permissible, provided there is no fear of soiling the mosque. This view is held by Al-Shafi'i, Ishaq, Abu Thawr, and Dawud. The evidence supporting this permissibility is the action of the Prophet Muhammad (peace be upon him), as narrated by Muslim and others, where Aisha (may Allah be pleased with her) stated that the Messenger of Allah (PBUH) only performed the funeral prayer for Suhayl ibn Bayda' in the mosque. Furthermore, there is narration that the funeral prayer for Abu Bakr was performed in the mosque, and the prayer for Umar ibn al-Khattab was also performed there, all in the presence of the Companions who did not object, indicating consensus (ijma'). Since it is a prayer, it should not be prohibited in the mosque like other prayers.
Supporting text
The practice is disliked (makruh) by Malik and Abu Hanifah. They base their view on a narration from Al-Musnad stating, 'Whoever prays over a corpse in the mosque has nothing,' meaning no reward. However, the narrator of this tradition, Salih Mawla al-Taw'amah, is considered weak by some scholars, with Ibn Abd al-Barr noting that some scholars reject all his narrations due to his confusion, while others accept only what he narrated from Ibn Abi Dhi'b specifically.