Persecution of minority Muslim groups
A number of minority groups within Islam have faced persecution by other Muslims for allegedly being incompatible with Sunni Islam. Ahmadis

The Ahmadiyya regard themselves as Muslims, but are seen by many other Muslims as non-Muslims and "heretics" since they are accused of not believing in the finality of prophethood since the death of Muhammad. Armed groups, led by the umbrella organization Khatme Nabuwwat ("Finality of Prophethood"), have launched violent attacks against their mosques in Bangladesh. They committed massacres against them which resulted in 2,000 Ahmadiyya deaths in Pakistani Punjab. Eventually, martial law had to be established and Governor general Ghulam Mohamed dismissed the federal cabinet. This anti-Ahmadiyya movement led Pakistani prime minister Zulfiqar Ali Bhutto to declare that the Ahmadiyyas were "non-Muslims". In 1984, the Government of Pakistan, under General Zia-ul-Haq, passed Ordinance XX, which banned proselytizing by Ahmadis and also banned Ahmadis from referring to themselves as Muslims. According to this ordinance, any Ahmadi who refers to oneself as a Muslim by words, either spoken or written, or by visible representation, directly or indirectly, or makes the call for prayer as other Muslims do, is punishable by imprisonment of up to 3 years. Because of these difficulties, Mirza Tahir Ahmad migrated to London, UK. Ajlafs and Arzals

Despite the claims of Islam's egalitarian tenets, units of social stratification, termed as "castes" by many, have developed among Muslims in some parts of South Asia. Various theories have been put forward regarding the development of castes among Indian Muslims. Majority of  sources state that the castes among Muslims developed as the result of close contact with Hindu culture and Hindu converts to Islam, while few others feel that these developed based on claims of descent from Muhammad. Sections of the ulema (scholars of Islamic jurisprudence) have declared the religious legitimacy of the caste system with the help of the concept of kafa'a. A classic example of scholarly literature supporting the Muslim caste system is the Fatawa-i Jahandari, written by the 14th century Turkish scholar, Ziauddin Barani, a member of the court of  Muhammad bin Tughlaq, of the Tughlaq dynasty of the Delhi Sultanate. Barani was known for his intensely casteist views, and he regarded the Ashraf Muslims as racially superior to the Ajlaf Muslims. He divided the Muslims into grades and sub-grades. In his scheme, all high positions and privileges were to be a monopoly of the high born Turks, not the Indian Muslims. Even in his interpretation of the Koranic verse "Indeed, the pious amongst you are most honored by Allah", he considered piety to be associated with noble birth. Barrani was specific in his recommendation that the "sons of Mohamed" [i.e. Ashrafs] "be given a higher social status than the low-born [i.e. Ajlaf]. His most significant contribution in the fatwa was his analysis of the castes with respect to Islam. His assertion was that castes would be mandated through state laws or "Zawabi" which would carry precedence over Sharia law whenever they were in conflict. In the Fatwa-i-Jahandari (advice XXI), he wrote about the "qualities of the high-born" as being "virtuous" and the "low-born" as being the "custodians of vices". Every act which is "contaminated with meanness and based on ignominy, comes elegantly [from the Ajlaf]". Barani had a clear disdain for the Ajlaf and strongly recommended that they be denied education, lest they usurp the Ashraf masters. He sought appropriate religious sanction to that effect. Barrani also developed an elaborate system of promotion and demotion of Imperial officers ("Wazirs") that was conducted primarily on the basis of caste. In addition to the Ashraf/Ajlaf divide, there is also the Arzal caste among Muslims, whose members were regarded by anti-Caste activists like Babasaheb Ambedkar as the equivalent of untouchables. The term "Arzal" stands for "degraded" and the Arzal castes are further subdivided into Bhanar, Halalkhor, Hijra, Kasbi, Lalbegi, Maugta, Mehtar etc. The Arzal group was recorded in the 1901 census in India and its members are also called Dalit Muslims "with whom no other Muhammadan would associate, and who are forbidden to enter the mosque or to use the public burial ground".They are relegated to "menial" professions such as scavenging and carrying night soil. Alawites

The Alawites are a sub group of the Muslim faith that believes in the divine nature of Ali, the cousin of Muhammad. Ibn Taymiyyah asserted that Alawites were not Shi'ites and were heretics outside Islam, arguably being the most virulent anti-Alawite in his fatwas where he stated that Alawites "are more infidel than Jews or Christians, even more infidel than many polytheists. They have done greater harm to the community of Muhammad than have the warring infidels such as the Franks, the Turks, and others. To ignorant Muslims they pretend to be Shi’is, though in reality they do not believe in God or His prophet or His book[...] Whenever possible, they spill the blood of Muslims[...] They are always the worst enemies of the Muslims[...] war and punishment in accordance with Islamic law against them are among the greatest of pious deeds and the most important obligations". The Ottomans often relied on Ibn Taymiyya's religious rulings to justify their persecution of Alawites. Mutazilites

In medieval Iraq, the Mu'tazili theological movement was made a state doctrine in 832, igniting the Mihna (ordeal) a struggle over the application of Greek logical proof of the Qu'ran; people who would not accept Mu'tazili claims that the Qur'an was created rather than eternal were sometimes persecuted. The most famous victims of the Mihna were Ahmad Ibn Hanbal who was imprisoned and tortured, and the judge Ahmad Ibn Nasr al-Khuza'i who was crucified. Ahmad Ibn Hanbal was dragged before the inquisition, known as the Mihna, ordered by the caliph al-Maʾmūn. However, it lost official support soon afterwards. This coincided with the rise to prominence of the Ash'ari approach to Islam, of which Al-Ghazali was a staunch defender. Sunni and Shi'a Islam became the mainstream schools of Islam. As a consequence, the tables turned and some Mutazili scholars were victims of persecution themselves in the centuries to follow. Some Islamic philosophers like Averroes and Avicenna also faced persecution from fellow Muslims in their time. Mu'tazilite doctrine – by now regarded as heretical by Sunnis – continued to be influential amongst some Shia in Persia and Zaydis in Yemen. Shi'a

Throughout history, Shi'as have faced genocide in Sunni majority locations. In 1513, Ottoman Sultan Selim I ("The Grim") ordered the massacre of 40,000 Shia "heretics" in Anatolia during the Safavid-Ottoman struggles. The Mughal emperor Aurengzeb is also recorded to have persecuted Shi‘a communities. His persecution of the Ismaili successor to Imam al-Din, or Imamshah, changed the course of the history of his community of followers. Common folk took up arms against the military and captured the fortress of Broach. However, their initial success did not last and, along with other sister communities, they were put down. While some strand in Sunni regards Shiism as a valid madhhab, following Al Azhar, some Sunnis both now and in the past have regarded it as beyond the pale, and have attacked its adherents. In modern times, notable examples include the bombing campaigns by the Sunni Sipah-e-Sahaba against Shia mosques in Pakistan, the genocide of Hazara under the Taliban, and the bloody attacks linked with Zarqawi and his Sunni followers against Shia in Iraq. Some of the worst Shia-Sunni sectarian strife has occurred before (under Saddam regime responsible for at least 400,000 Shia deaths) and after the American invasion of Iraq. According to one estimate, as of early 2008, 1,121 Sunni suicide bombers have blown themselves up in Shia-majority Iraq. Sunni suicide bombers have targeted not only thousands of civilians, but mosques, shrines, wedding and funeral processions, markets, hospitals, offices, and streets. The Saudi Arabian government has been viewed as repressive against Shias living in Saudi Arabia, mainly because it encourages the Salafi faith, which denounces Shia Islam as heretical. Shias are mainly persecuted due to the belief that they are Iranian "puppets" and traitors. In several Saudi Arabian cities, Shia azans and Ashura demonstrations are banned. Sunni Muslims

The Safavid conversion of Iran to Shia Islam was a process that took place roughly over the 16th through 18th centuries and turned Iran (Persia), which previously had a Sunni majority, into the spiritual bastion of Twelver Shi'ism. It was a process that involved forced conversion

Ismail I consolidated his rule over the country and launched a thorough and, at times, brutal campaign to convert the majority Sunni population to Twelver Shiism and thus transform the religious landscape of Iran. His methods of converting Iran included:
Imposing Shiism as the state and mandatory religion for the whole nation and much forcible conversion of Iranian Sufi Sunnis to Shiism. He reintroduced the Sadr (Arabic, leader) – an office that was responsible for supervising religious institutions and endowments. With a view to transforming Iran into a Shiite state, the Sadr was also assigned the task of disseminating Twelver doctrine. He destroyed Sunni mosques. This was even noted by Tomé Pires, the Portuguese ambassador to China who visited Iran in 1511–12, who when referring to Ismail noted: "He (i.e. Ismail) reforms our churches, destroys the houses of all Moors who follow (the Sunnah of) Muhammad…"
He enforced the ritual and compulsory cursing of the first three Muslim Caliphs (Abu Bakr, Umar, and Uthman) as usurpers, from all mosques, disbanded Sunni Tariqahs and seized their assets, used state patronage to develop Shia shrines, institutions and religious art and imported Shia scholars to replace Sunni scholars. He killed Sunnis and destroyed and desecrated their graves and mosques. This caused the Ottoman Sultan Bayezid II (who initially congratulated Ismail on his victories) to advise and ask the young monarch (in a "fatherly" manner) to stop the anti-Sunni actions. However, Ismail was strongly anti-Sunni, ignored the Sultan's warning, and continued to spread the Shia faith by the sword. He persecuted, imprisoned, exiled, and executed stubbornly resistant Sunnis. With the establishment of Safavid rule, there was a very raucous and colourful, almost carnival-like holiday on 26 Dhu al-Hijjah (or alternatively, 9 Rabi' al-awwal) celebrating the Eid-e-Shuja' or Celebration of assassination of Caliph Umar. The highlight of the day was making an effigy of Umar to be cursed, insulted, and finally burned. However, as relations between Iran and Sunni countries improved, the holiday was no longer observed (at least officially). In 1501, Ismail invited all the Shia living outside Iran to come to Iran and be assured of protection from the Sunni majority. Safavid rulers vandalized and desecrated the grave of famous Early Muslim theologian Abu Hanifa. Safavids expelled large number of Iranian Sunni Muslims from Iran who refused to convert Twelver shi'ism. Most of these Sunnis settled in the neighbouring Empires; Mughal Empire, Ottoman Empire and Gulf Arab states. Yaqub Beg's Uyghur forces declared a Jihad against Chinese Muslims under T'o Ming during the Dungan revolt. The Uyghurs thought that the Chinese Muslims were Shafi`i, and since the Uyghurs were Hanafi that they should wage war against them. Yaqub Beg enlisted non Muslim Han Chinese militia under Hsu Hsuehkung in order to fight against the Chinese Muslims. T'o Ming's forces were defeated by Yaqub, who planned to conquer Dzungharia. Yaqub intended to seize all Dungan territory. Takfiris

Certain small groups – the Kharijites of early medieval times, and Takfir wal Hijra- follow takfirist doctrines, regarding almost all other Muslims as infidels whose blood may legitimately be shed. Wahhabis

The Kuomintang Sufi Chinese Muslim General Ma Bufang, who backed the Yihewani (Ikhwan) Muslims, persecuted the Salafi/Wahhabis. The Yihewani forced the Salafis into hiding. They were not allowed to move or worship openly. The Yihewani had become secular and Chinese nationalist, and they considered the Salafiyya to be "Heterodox" (xie jiao), and people who followed foreigner's teachings (waidao). Only after the Communists took over were the Salafis allowed to come out and worship openly. 