The Dailamite territories in this period extended from the Chalus river westward along the coast to about the Gavarud and in the highlands as far as the valley of the Safldrud in its middle course. Along the southern slopes of the Alburz the Dailamites occupied the basin of the Shahrud, separated from the plains of Qazvin by a chain of hills. The lowlands around the delta of the Safldrud were occupied by the Gilites. The Dailamites and the Gilites spoke dialects which were different enough from the language of the majority of Persians to be incomprehensible to them. They were divided into tribes, and political authority was exercised by tribal chiefs on a hereditary basis. A dynasty of "kings of the Dailamites" known as the Justanids was recognized, though it is not clear how far their authority extended outside their own tribe. Their seat was in Rudbar, in a side valley of the Shahrud basin, where in 246/860-1 one of them is said to have built the fortress of Alamut.
The Justanids, whose origins are unknown, are first mentioned in the sources c, 176 when one of them gave shelter to the 'Alid refugee Yahya b. 'Abd-Allah. Harun al-Rashid during his visit to Ray in 189/805 received Marzuban b. Justan, lord of the Dailamites, and sent him off with gifts. At the time of al-Hasan b. Zaid's arrival in Kalar, the Justanid Vahsudan b. Marzuban at first pledged allegiance to him, but soon withdrew his support and died in 251/865. His successor Khurshld was hostile, but the 'Alid was able to neutralize his influence among the Dailamites, and he was soon replaced by Justan b. Vahsudan who rendered important services to both al-Hasan and Muhammad. The GUites, according to a single source which may not be entirely reliable, recognized kings of their own who belonged to a royal clan Shahanshahvand and resided in the Dakhil region north of Lahijan. The kingship was not strictly hereditary and was transferred within the royal clan and even to another, related clan. The first king of the Gilites mentioned, Tirdadh, father of Harusindan, must have been contemporary with the 'Alid brothers, though the Gilites generally remained aloof from support of their cause.
While Tabaristan came under the rule of the Samanid Isma'il who restored Sunnism and granted generous compensation to many victims of the ZaidI regime, the Zaidi cause was furthered among the Dailamites by an 'Alid who had belonged to the entourage of the two DaTs. The Husainid al-Hasan b. cAll al-Utrush after the defeat of Muhammad b. Zaid fled to Ray from where he soon followed an invitation of Justan b. Marzuban who promised him support in avenging the Da'i and recovering Tabaristan. Two campaigns which they undertook jointly in 289/902 and 290/903 ended in failure. Al-Utrush later left Justan in order to summon the Dailamites north of the Alburz and the Gilites to Islam, taking his abode in turn in Gilakjan, in the valley of the Pulirud among the Dailamites, and in Hausam (modern Rudisar) among the Gilites.
Al-Utrush converted most of the Dailamites "of the interior" and the Gilites east of the Safidrud who accepted him as their imam with the regnal name al-Nasir li'1-haqq. The Zaidi legal and ritual doctrine which he taught them diverged to some extent from the doctrine of al-Qasim b. Ibrahim to which the Zaidis converted earlier in Ruyan and Dailaman adhered. These divergencies later provoked fanatical antagonism between the Nasiriyya, the followers of the school of al-Utrush, and the Qasimiyya, the supporters of the doctrine of al-Qasim. The conflict had wider implications, since a grandson of al-Qasim, Yahya al-Hadi ila'1-haqq in 284/897 succeeded in founding a Zaidite state in the Yemen. He and his successors there espoused and developed the doctrine of al-Qasim. The Caspian Qasimiyya thus was tempted to look for guidance and leadership to the Zaidite imams of the Yemen. In fact a substantial contingent of Tabaris, probably mostly from Ruyan, rendered al-Hadi effective military aid.