“…Keep your children away from your mosques…,” the report says, and it also contains the clause, “…and do not carry out your legal penalties there.”
Its chain of transmission is weak, as was mentioned earlier when discussing the first portion of the etiquette.
The ḥadith—if taken as evidence—indicates that it is unlawful to enforce legal penalties or acts of retaliation in the mosque, for a prohibition, according to the principles of jurisprudence, retains its literal force unless something diverts it. Here, no such factor exists. This is the conclusion stated in Nayl al-Awṭār and similarly in Subul al-Salām.
Whoever, like the Shāfiʿīs, contends that the prohibition is merely one of dislike must advance proof. Al-Munāwī writes in al-Fayḍ:
“It is reprehensible as a matter of propriety. However, should a person liable to retaliation take refuge in a mosque, it is permissible to exact the punishment there—even in the Sacred Mosque—by spreading a hide on the ground and hastening to fulfil the right, according to al-Shāfiʿī. Abū Ḥanīfah maintains that he is not to be put to death within the Sanctuary; rather, he is compelled to leave it.”
I say: The view of Abū Ḥanīfah appears stronger, because the ḥadith is unrestricted and makes no exceptions. Al-Mirqāt adds:
“Doing so would violate the mosque’s sanctity and risks staining it with blood or other impurities. Ibn Abī Laylā’s statement that the punishment may be carried out inside is anomalous.” So reported Ibn Ḥajar. Ibn al-Malik said, “So that the mosque is not sullied.” In Sharḥ al-Sunnah it is related that ʿUmar, concerning someone due a legal penalty inside the mosque, ordered, “Take him outside,” and the same is attributed to ʿAlī.
What is known of the Prophet’s practice is that he enforced the penalties outside the mosque, as