Shia Islam in Medieval Northern Iran: The Alid dynasties of Tabaristan, Daylam, and Gilan

By Adam Ali

In part three of this series that looks at medieval northern Iran the focus turns to the emergence of the Alid dynasty and their struggle to gain and hold power in the ninth and tenth centuries. 

The regions of Gilan, Daylam, and Tabaristan that cradled the southern shores of the Caspian Sea in Northern Iran were unique in many ways. The inhabitants of this area were a tough, warlike, and independent people. For centuries they resisted the conquest attempts of several empires and maintained their autonomy from the Achaemenids, Parthians, and Sassanians. Sometimes they paid tribute, at others they allied with their powerful neighbors providing excellent infantrymen for their armies, and at some points they even openly defied these empires and waged war on them.


When the Muslims conquered the Sassanian Empire during the 7th century, the hardy inhabitants of the region put up a similar resistance to them. In addition to the military prowess and ferocity of the peoples of Northern Iran, especially the Daylamis (also referred to as Daylamites), the tropical climate of the lowlands and the mountain ranges and highlands made invading this region very difficult. For this reason, the inhabitants of the Caspian region maintained their own culture, languages, and religion. There were some Zoroastrians and Christians living there, but most of them followed pagan religions and the dialect spoken by both the Daylamis and the Gilakis (also referred to Gilites) were so different from those spoken by other Iranians such as the Persians that they were incomprehensible to them. This was a tribal society in which political authority was wielded by chiefs.

The Justanid dynasty of Daylam claimed kingship over the Daylamis, but it is unlikely their direct authority extended far beyond their own tribe. Due to their fierce independence and their constant opposition to the attempts of the caliphate to conquer them, the Daylamis and Gilakis granted refuge to Alid rebels fleeing Abbasid persecution and when they did convert to Islam, many of them converted to Zaydi Shiism in opposition to the Sunni (or proto-Sunni) Islam professed by the caliphate and the majority of the Muslims living in Iraq and Iran at the time.


The term “Alids” refers to the early Shias in Islamic history, both the descendants of Ali (the prophet’s cousin and son in law) and their partisans. Within Shiism there were several sects including the Imami Twelvers, the Ismaili Seveners, and Zaydis that were (and still are) the largest groups. Several other groups also existed among them the followers of Muhammad ibn al-Hanafiyya, those who followed one of the many descendants of al-Hasan (Alis elder son), and several factions and groups of “ghulat” or extremists whose views and beliefs did not conform to those of Sunni and most of the other Shia Muslims.

The first contacts the Daylamis had with Shia Islam took place in 791 during the reign of the Abbasid caliph, Harun al-Rashid (r. 786-809), when Yahya ibn Abdallah, a Hasanid (i.e descendent of al-Hasan) rebel, took refuge with the Justanids with some of his followers. It is unclear if this contact had any religious influence on the inhabitants of the region. It was not until the mid-9th century that Zaydi Shiism spread in the Caspian region. It was the followers and missionaries of the Medinese Zaydi Imam Qasem Ibn Ibrahīm (d. 860) who introduced this sect of Islam to Western Tabaristan, the region of Ruyan, Kalar, and Chalus. At this time a dynasty of governors known as the Tahirids ruled the large eastern province of Khurasan in the caliphates. They had received their mandate and a certain degree of autonomy from al-Mamun and his descendants due to the prominent role the founder of the dynasty, Tahir ibn Husayn, played in the Abbasid Civil War (811-819)  between al-Mamun and his brother, al-Amin.

The Zaydi dynasty

The inhabitants of Western Tabaristan revolted in 864 against the heavy handedness of the Tahirid officials and after allying with the Daylamis against the authorities they invited Hasan ibn Zayd, a Hasanid residing in the City of Rayy, to be their ruler. Hasan ibn Zayd accepted the invitation, took the title of al-Dai ila al-Haqq (meaning he who summons to the truth), and became the founder of the first Zaydi dynasty to rule the Caspian region. He was forced out of his domains three times by Tahirid counter attacks in 865, 869, and 874. Each time he took refuge in the highlands with the Daylamis and with their support he was able to recover his lost territories.

Hasan ibn Zayd’s Dirham – photo by Classical Numismatic Group / Wikimedia Commons

He died in 884 with Tabaristan and Gorgan firmly under his control. He named his bother Muhammad ibn Zayd as his successor in Gorgan. Muhammad, who also took the title of al-Dai ila al-Haqq, had to contend with his brother-in-law, Ali ibn al-Husayn, who had seized power in the Tabaristan and was able to defeat him within ten months. In 891 Muhammad ibn Zayd suffered a major setback when Rafi ibn Harthama, who was then the governor of Khurasan, drove him out of Tabaristan and penetrated deep into the highlands of Daylam. It was at this crucial moment in 892 when the new Abbasid caliph, al-Mutadid (r. 892-902), granted the governorship of Khurasan to the Saffarid, Amr ibn Layth. This transfer of power in Khurasan caused Rafi Ibn Harthama to make peace with Muhammad ibn Zyad and to pledge allegiance to him. With his help Muhammad ibn Zayd reconquered Tabaristan. In 900 Muhammad ibn Zayd personally led an expedition to conquer Khurasan. His army was defeated by the Samanids, an Iranian dynasty ruling Transoxania and Khurasan at the time. He was killed in battle near Gorgan and buried there. His heir was captured and taken to Bukhara and Tabaristan was conquered and became a part of the Samanid domains.


The Rise of al-Utrush

After the Samanid conquest of Tabaristan the cause of the Zaydi Alids in the Caspian region was taken up by al-Husayn ibn Ali al-Utrush, an Alid who had been a member of the first two Zaydi rulers’ entourage. He fled the battlefield after Muhammad ibn Zayd’s defeat and went to Rayy. The Justanid king, Justan ibn Vahsudan, invited him to Daylam and promised him support to reconquer Tabaristan and to avenge Muhammad ibn Zayd. Justan and al-Utrush led two expeditions to conquer Tabaristan in 902 and 903, but both of these campaigns failed. After these setbacks, al-Utrush left Justan and travelled north of the Alborz range aiming to gather support among the Daylamis and Gilakis there. He succeeded in converted most of the Daylamis in the interior and the eastern Gilaikis who accepted him as their ruler and imam and he took the title al-Nasir li al-Haqq (meaning the supporter of the truth).

On the other hand many of the Gilakis to the west converted to Sunni Islam. Justan, concerned at his loss of authority among the Daylami tribes of the north, tried to oppose al-Utrush and to prevent him from levying taxes. However, al-Utrush had the stronger position and Justan was compelled to swear allegiance to him. In 914 al-Utrush crushed the Samanid army at Burdidah on the Burud River and occupied the city of Amol. A Samanid counter attack forced him back to Chalus the following year, but he was able to push them out within 40 days occupying all of Tabaritsan and Gorgan. Al-Utrush died in 917. He was remembered as a fair and just ruler, even by the Sunni population. Writing about him, the great historian al-Tabari, who was a Sunni and a native of Amol, states “”the people had not seen anything like the justice of al-Utrush, his good conduct, and his fulfilment of the right.”

Tomb of Hasan al-Utrush in Amol – photo by Mirasir / Wikimedia Commons

Al-Utrush was succeeded by the Alid commander-in-chief of his army, al-Hasan ibn Qasim. His Zaydi followers, with the exception of the local Daylamis and Gilakis had been opposed to any of his sons succeeding him because they felt that they lacked the leadership skills and charisma for the role. Even before al-Utrush’s death there had been rivalries and quarrels between his sons and al-Hasan and al-Utrush was compelled to name al-Hasan, due to his powerful position, as his successor. Al-Hasan took the title al-Dai ila al-Haqq. He was initially supported by one of al-Utrush’s sons, Abu al-Hasan Ahmad, against another son, Abu al-Qasim Jafar, who tried to seize the throne by force. Ahmad changed sides and joined his brother forcing al-Hasan to flee after being defeated in battle. He returned with an army from Gilan after seven months, defeated Ahmad in battle and forced Jafar to flee. Al-Hasan came to an agreement with Ahmad whom he appointed as his governor in Gorgan.


Al-Hasan sent an expedition to conquer to conquer Khurasan in 921. His commander, Lili ibn al-Numan, initially succeeded in conquering Damghan, Nishapur, and Merv. However, Lili’s forces were defeated by the Samanid army and he was killed in battle. Several of the Daylami and Gilaki chiefs from the defeated army hatched a plot to depose and kill al-Hasan. The latter discovered the plot and invited the chiefs to a reception and in a very “red wedding-like” manner had them killed. The direct consequence of this massacre was that a group of the Daylami and Gilaki soldiers in al-Hasan’s army became disaffected and deserted him. With the weakening of al-Hasan, Ahmad once again made common cause with his brother Jafar in 923 and together they succeeded in driving him out of his domains and into the highlands. The brothers did not live long to enjoy their success. Ahmad died two months after defeating al-Hasan while Jafar died in 925.

The fight for Tabaristan

The position of the Alid rulers of Tabaristan became greatly weakened after this point. The constant quarrels among the Alids strengthened the Daylami and Gilaki chiefs who became kingmakers and who used the Alid princes as pawns in their own power struggles against one another. Two Daylami leaders rose to dominance in these power struggles: Makan ibn Kaki and Asfar ibn Shiruya. At one point Makan made common cause with the exiled al-Hasan and restored him to the throne of Tabaristan driving out Asfar (who had scored an initial victory over Makan earlier). Together al-Hasan and Makan set out on a major campaign of conquest and took control of Rayy and the province of Jibal as far as Qum. Asfar, who was now a mercenary in the service of the Samanids took the opportunity of their absence to retake Tabaristan. Al-Hasan rushed back by himself to face Makan. His army was defeated at the gates of Amol, where he was killed in battle by one of Asfar’s officers, Mardavij ibn Ziyar. There was some poetic justice in this end because Mardavij’s uncle was among the chieftains whom al-Hasan had murdered at the reception massacre in 921.

After these events serval Alids were rounded up by Asfar, at the bidding of his Samanid overlord, and sent to Bukhara. The last influential Alid, Abu Jafar, who had been released from prison in Bukhara during civil unrest and revolts in the city attempted to regain power in Tabaristan with the help of Mardavij ibn Ziyar, who had revolted against Asfar. Abu Jafar ultimately failed and retired to Rayy in 943 after its conquest by the Buyid, Rukn al-Dawla and lived there until his death without any political authority. The Alids were unable to recover their power in Tabaristan and the ball was now in the field of Daylami and Gilaki warlords and soldiers of fortune.

After almost a century of Alid rule in the Caspian region and endless military campaigns against both external foes and in internal power struggles, the Daylmis and Gilakis became experienced soldiers. They poured out of their homeland as mercenaries serving the caliphs and the regional dynasties of the Muslim world and as conquering armies carving out empires under the leadership of their chieftains who were now adept generals, many of whom had imperial and dynastic ambitions of their own.


Adam Ali is a lecturer at the University of Toronto. Click here to read more from Adam.

Top Image: