Narrated by Sayyiduna Hakim bin Hizam (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "No legal punishments should be carried out in the mosques, nor should retribution (qisas) be taken there."
Hadith Takhrij«اسناده ضعيف لجھالة العباس بن عبد الرحمن المدني۔ أخرجه ابن ابي شيبة: 10/ 42، والطبراني في ’’الكبير‘‘: 3131، والدارقطني في ’’السنن‘‘: 3/ 86 ، (انظر مسند أحمد ترقيم الرسالة: 15579 ترقیم بيت الأفكار الدولية: 15664»
Brief Explanation
Benefits: … This narration is authentic with the following wording: Sayyiduna Hakim bin Hizam radi Allahu anhu says: “The Messenger of Allah sallallahu alayhi wa sallam forbade that retribution (qisas) be taken in the mosque, that poetry be recited therein, and that legal punishments (hudud) be carried out therein.” … The Messenger of Allah sallallahu alayhi wa sallam forbade that retribution be taken in the mosque, that poetry be recited therein, and that legal punishments be carried out therein. (Abu Dawud: 4490)
It is thus understood that neither should any legal punishment (hadd) be carried out in the mosque, nor should retribution (qisas) be taken, because the purpose of constructing the mosque is the remembrance of Allah Ta’ala, recitation (of the Qur’an), and prayer (salah).
The command to kill Ibn Khatal was given because he had become an apostate; he used to satirize the Noble Prophet sallallahu alayhi wa sallam, he had killed a Muslim servant of the Prophet sallallahu alayhi wa sallam, and his two slave girls also used to speak ill of the Noble Prophet sallallahu alayhi wa sallam and the Muslims. (Abdullah Rafiq)