The Alids are those who claim descent from Ali ibn Abi Talib (; 600–661 CE), the fourth Rashidun caliph () and the first imam in Shia Islam. Ali was also the cousin and son-in-law of the Islamic prophet Muhammad. The main branches are the Hasanids and Husaynids, named after Hasan and Husayn, the eldest sons of Ali from his marriage to Fatima, the daughter of Muhammad. As the progeny of Muhammad, they are revered by all Muslims. The Alids have led various movements in Islam, and a line of twelve Alids are the imams in Twelver Shia, the largest Shia branch.

Children of Ali

In addition to seventeen daughters, various sources report that Ali had eleven or fourteen, or eighteen sons. His first marriage was to Fatima, daughter of the Islamic prophet Muhammad, who bore Ali three sons, namely, Hasan, Husayn, and Muhsin, though the last one is not mentioned in some sources. Muhsin either died in infancy, or was miscarried after Fatima was injured during a raid on her house to arrest Ali, who had withheld his pledge of allegiance from the first Rashidun caliph Abu Bakr (). The former report appears is Sunni sources and the latter in Shia sources. Hasan and Husayn are recognized as the second and the third Imams in Shia Islam, their descendants being known as the Hasanids and the Husaynids, respectively. They are revered by all Muslims as the progeny of Muhammad and honored by nobility titles such as Sharif and Sayyid. Ali and Fatima also had two daughters, namely, Zaynab and Umm Kulthum. After the death of Fatima in 632 CE, Ali remarried and had more children. Among them, the lineage of Ali continued through Muhammad ibn al-Hanafiya, Abbas ibn Ali, and Umar al-Atraf, their descendants were honored by the title Alawi (). Respectively, they were born to Khawla al-Hanafiyya, Umm al-Banin, and Umm Habib bint Rabi'a (al-Sahba).

Alids

Alids in history

Umayyads era ()

Alids

Mu'awiya seized the rule after the assassination of Ali in 661 and founded the Umayyad Caliphate, during which the Alids and their supporters were heavily persecuted. After Ali, his followers () recognized as their imam his eldest son Hasan. After his death in 670, they turned to his brother Husayn, but he and his small caravan were massacred by the Umayyads in the Battle of Karbala in 680. Soon followed the Shia uprising of al-Mukhtar in 685 on behalf of Muhammad ibn al-Hanafiya. Many more Shia revolts followed afterward, led not only by the Alids but also by other kinsmen of Muhammad.

Alids

The main movements in this period were the now-extinct Kaysanites and the Imamites. Named after a commander of al-Mukhtar, the Kaysanites energetically opposed the Umayyads and were led by various relatives of Muhammad. Their majority followed Abu Hashim, the son of Ibn al-Hanafiya. When Abu Hashim died around 716, this group followed Muhammad ibn Ali ibn Abd-Allah, the great-grandson of Muhammad's uncle Abbas ibn Abd al-Muttalib. The Kaysanite movement thus aligned itself with the Abbasids, that is, the descendants of Abbas ibn Abd al-Muttalib. On the other hand, the Imamites were led by the quiescent descendants of Husayn through his only surviving son, Ali Zayn al-Abidin (), their fourth imam. His son Zayd ibn Ali was an exception for he led a failed uprising against the Umayyads around 740. The followers of Zayd went on to form the Zaydites, for whom any learned Hasanid or Husaynid who rose against tyranny was qualified as imam.

Abbasids era () To overthrow the Umayyads, the Abbasids had rallied the support of the Shia in the name of the Ahl al-Bayt, that is, the family of Muhammad. But many Shias were disillusioned when the Abbasid al-Saffah () declared himself caliph, as they had hoped for an Alid leader instead. The Abbasids soon turned against their former allies and persecuted the Alids and their Shia supporters. In response, Shia doctrinally limited its leadership to the Alids, many of whom revolted against the Abbasids, including the Hasanid brothers Muhammad ibn Abd-Allah () and Ibrahim. Some Alids instead took refuge in remote areas and founded regional dynasties in the southern shores of the Caspian sea, Yemen, and western Maghreb. For instance, the revolt of the Hasanid Husayn ibn Ali al-Abid was suppressed in 786 but his brother Idris () escaped and founded the first Alid dynasty in Morocco. Similarly, a number of Zaydite rules appeared in northern Persia and in Yemen, the latter of which has survived to the present day.