The well-known ḥadīth concerning al-Ḥijr accords with this, for when the Prophet forbade entering a land upon which punishment had descended, that prohibition necessarily included performing the prayer there and every other act of worship (1).
The same sense is conveyed by the Almighty’s words regarding the Mosque of Harm (Masjid al-Dirār): “Never stand in it!” (Qur’an 9:108) (2). Since that mosque was one of the places of chastisement, Allah—exalted is He—also said: “Is one who laid the foundation of his building upon mindfulness of Allah and His good pleasure better, or one who laid the foundation of his building upon the brink of a crumbling precipice that collapsed with him into the Fire of Hell?” (Qur’an 9:109) (3). It has been reported that when the structure was demolished, smoke rose from it (4).
Just as the Prophet—peace and blessings be upon him—encouraged prayer in places of mercy, such as the three sacred mosques (5) and the mosque of Qubāʾ (6), he likewise forbade praying in
(1) The printed edition adds the phrase, “and other places even more so,” an expansion not found in any of the manuscript copies.
(2) Quran, Surah al-Tawba 9:108.
(3) Quran, Surah al-Tawba 9:109.
(4) The sira works relate that the Prophet ordered that mosque to be burned. See Ibn Ishaq, Sirat al-Nabi; the recension of Ibn Hisham 4:956; and Ibn Kathir, al-Sira al-Nabawiyya 4:40.
(5) Al-Bukhari, “The Excellence of Prayer in the Mosques of Mecca and Medina,” hadith no. 1189 (Fath al-Bari 3:63), where Abu Hurayra reports that the Prophet said, “Do not undertake a journey except to three mosques: the Sacred Mosque, this Mosque of mine, and al-Aqsa Mosque.” In the next hadith, no. 1190, also from Abu Hurayra, he states, “One prayer in this Mosque of mine is better than a thousand prayers elsewhere, except for the Sacred Mosque.”
(6) Al-Tirmidhi, Sunan, Book of Prayer, “Prayer in the Mosque of Qubaʾ,” hadith no. 324 (2:145–46), from Usayd b. Zuhayr al-Ansari: “Prayer in the Mosque of Qubaʾ is like an ʿumra.” Al-Tirmidhi classed it as hasan gharib. Al-Hakim recorded it in al-Mustadrak 1:487, judging the isnad sound, though he noted that one transmitter, Abu al-Abrad, is unknown. Both Sahih al-Bukhari and Sahih Muslim confirm that the Messenger of Allah used to visit the Mosque of Qubaʾ every Saturday and pray two rakʿas there; see Fath al-Bari, hadith nos. 1193–1194 (3:69) and Muslim, hadith no. 1399 (2:1016–17).