The demolition or burning of Masjid al-Dirar (Arabic: مسجد الضرار), or the Mosque of Dissent, is mentioned in the Qur'an. Masjid al-Dirar was a Medinian mosque that was erected close to the Quba' Mosque and which the Islamic Prophet Muhammad initially approved of but subsequently had destroyed while he was returning from the Expedition to Tabouk (which occurred in October 630 CE). In the main account narrated by the majority of scholars, the mosque was built by twelve disaffected men from the Ansar on the commands of Abu 'Amir al-Rahib; a Hanif who refused Muhammad's invitation to Islam and instead fought along with the Meccan non-Muslims against Islam in the Battle of Uhud. Abu 'Amir reportedly urged his men to establish a stronghold and prepare whatever they can of power and weapons as he promised and insinuated to them that he will lead an army, backed by Heraclius, to fight Muhammad and his companions, and defeat his message by expelling him from Medina. Ahmad ibn Yahya al-Baladhuri also relates that the men, who built the Al-Dirar mosque "for mischief and for infidelity and to disunite the Believers" refused to pray in Masjid al-Quba claiming that it was built in a place where a donkey used to be tied up.
Muhammad prepared himself to go to the Mosque, before he was prevented by a revelation about the hypocrisy and ill design of the builders of the Mosque
According to the Islamic tradition, Muhammad was asked to lead prayer there but received a revelation (mentioned in the Qur'anic verses 9:107 and 9:110) in consequence of which the mosque was destroyed by fire. Hencerforth, it was known as the Mosque of Opposition.
Abu Amir ar- Rahib was a Hanif. Hanif's stood closer to Christianity than Judaism. He disliked Muhammad, and reportedly fought in the Battle of Badr. He wanted him expelled from Medina and Islam eradicated. He also joined the Quraysh against the Muslim in the Battle of Uhud. The Majority have said that Abu Amir asked the ruler of the Byzantine for help against Muhammad. Muhammad's companion Abd-Allah ibn Ubayy was his nephew. Abu Amir died in 9AH or 10AH of the Islamic calendar in the court yard of Heraclius.
Ibn Kathir mentions in his Tafsir that Abu `Amir Ar-Rahib (a Christian monk) told some disaffected Muslim Ansar to build the mosque. Abu Amir is reported to have said to some people that he will go to the emperor (Caesar) of the Byzantine Empire and return with Roman soldiers, to expel Muhammad.
According to Ar-Rahīq al-Makhtum (the Sealed Nectar), a modern Islamic hagiography of Muhammad written by the Indian Muslim author Saif ur-Rahman Mubarakpuri, a mosque called Masjid-e-Darar (the mosque of harm) was created by the Munafiq (hypocrites). When the mosque was completely built, the creators approached Muhammad and asked him to pray in it. But Muhammad put the request on hold till his return from the Battle of Tabuk. Through a "Divine Revelation", Muhammad was told that the Mosque was promoting anti-Islamic elements. Thus, on Muhammad's return from Tabuk, he sent a party of Muslim fighters to demolish the mosque.
Ahmad ibn Yahya al-Baladhuri also mentioned this. He said the Mosque was built by some men who refused to pray in Masjid al-Quba because it was built in a place where a donkey was tied up. Rather they said they will build another mosque until Abu Amir could lead the service in it. But Abu Amir did not convert to Islam, rather he left Medina and converted to Christianity. The Banu Amir ibn Awf built Masjid al-Quba and Muhammad led the prayer in it, but there brother tribe, the Banu Ghan ibn Auf were jealous and also wanted Muhammad to pray in the Mosque, they also said that: "Abu Amir may pass here on his way from Syria, and lead us in prayer" Muhammad prepared himself to go to the Mosque, before he was prevented by a revelation about the hypocrisy and ill design of the builders of the Mosque
When Muhammad was returning from Tabuk, the Muslims halted at Dhu Awan. Some Muslims constructed the mosque claiming it was for the sick and needy, but because of Muhammad's belief that it was an opposition mosque, he sent Muslim fighters to burn it down. The men entered the mosque and set fire to it with its people inside, "and the people ran away from it".
Isma'il Qurban Husayn (translator of Tabari, Volume 9, Last years of the prophet) speculated by saying in footnote 426, that the people were "probably" linked to those who wanted to kill Muhammad in the Battle of Tabuk, but Tabari himself did not make that claim.
William Muir mentions that Muhammad believed the Mosque was built to create disunity among Muslims by drawing people away from another Mosque in Quba i.e. Masjid al-Quba, which was the first Mosque to be built by Muslims.
Muhammad ibn Abd al-Wahhab at-Tamimi mentioned in an abridged version of Ibn Qayyim Al-Jawziyya's biography of Muhammad (named Zad al-Ma'ad), that the mosque was burnt down, and he also used this event to justify his belief that burning down places of sin is permissible in Islam.
The event is mentioned in the Quran verse 9:107, the verse states:
|“||And there are those who put up a mosque by way of mischief and infidelity - to disunite the Believers - and in preparation for one who warred against Allah and His Messenger aforetime. They will indeed swear that their intention is nothing but good; But Allah doth declare that they are certainly liars. [Quran 9:107]||”|
The Muslim scholar Ibn Kathir's commentary on this verse is as follows:
|“||(If we come back from our travel, Allah willing.) When the Messenger of Allah came back from Tabuk and was approximately one or two days away from Al-Madinah, Jibril came down to him with the news about Masjid Ad-Dirar and the disbelief and division between the believers, who were in Masjid Quba' (which was built on piety from the first day), that Masjid Ad-Dirar was meant to achieve. Therefore, the Messenger of Allah sent some people to Masjid Ad-Dirar to bring it down before he reached Al-Madinah. `Ali bin Abi Talhah reported that Ibn `Abbas said about this Ayah (9:107), "They are some people of the Ansar to whom Abu `Amir said, `Build a Masjid and prepare whatever you can of power and weapons, for I am headed towards Caesar, emperor of Rome, to bring Roman soldiers with whom I will expel Muhammad and his companions.' When they built their Masjid, they went to the Prophet and said to him, "We finished building our Masjid and we would like you to pray in it and invoke Allah for us for His blessings
[Tafsir ibn Kathir on 9:107].
The event is mentioned by the Muslim jurist Tabari as follows:
|“||"The Messenger of God proceeded until he halted in Dhu Awan, a town an hour’s daytime journey from Medina. The people who had built the Mosque of Dissent (masjid al-dirar) had come to him while he was preparing for Tabuk saying, ‘O Messenger of God, we have built a mosque for the sick and needy and for rainy and cold nights, and we would like you to visit us and pray for us in it.’ [The Prophet] said that he was on the verge of traveling, and he was preoccupied, or words to that effect, and that when he returned, God willing, he would come to them and pray for them in it. When he stopped in Dhu Awan, news of the mosque came to him, and he summoned Malik b. al-Dukhshum, a brother of the Banu Salim b. ‘Awf, and Ma’n b. ‘Adi, or his brother ‘Asim b. ‘Adi, brothers of the Banu al-‘Ajlan, and said, "Go to this mosque whose owners are unjust people and destroy and burn it". They went out briskly until they came to the Banu Salim b. ‘Awf who were Malik b. al-Dukhshum’s clan. Malik said to Ma’n, "Wait for me until I bring fire from my people." He went to his kinsfolk and took a palm branch and lighted it. Then both of them ran until they entered the mosque, its people inside, set fire to it and destroyed it and the people dispersed. Concerning this, it was revealed in the Quran...
[Tabari, Volume 9, The last Years of the Prophet, pg 60-61]
Muhammad ibn Abd al-Wahhab at-Tamimi (founder of the Wahhabi movement) mentioned the following in an abridged version of Ibn Qayyim Al-Jawziyya's biography of Muhammad (named Zad al-Ma'ad), about this event:
|“||We also derive from this story the permissibility of burning places of sin and disobedience, as the Prophet burnt Masjid Ad-Dirar (the Mosque of Harm); and it is incumbent upon the Imam to destroy it, either by demolishing it or burning it, or by altering its shape and changing its function.
And if that was the case regarding Masjid Ad- Dirar, then the shrines where Shirk is practised should with all the more reason be destroyed and likewise the houses of the wine merchants and those who do evil deeds; Umar burnt down a whole village in which wine was sold. And he burnt down the palace of Sa'd when he secluded himself in it from the people and the prophet intended to burn down the houses of those who did not attend the Friday prayer or the Congregational prayers; and the only thing which prevented him was the presence therein of persons whom it was not obligatory...
[Abridged Zad al Ma'ad, Ibn Qayyim Al-Jawziyya, 429] 
|title=(help)Note: Book contains a list of battles of Muhammad in Arabic, English translation available here, and archive of page here
Abu ‘Amir eventually left Medina in A.H. 3, after once more joining Quraysh against the Muslims, this time at the Battle of Uhud