In 904/1499, Shah Ismail had decided that the time was ripe for the supreme bid for power. He prepared a colossal army, and began to conquer the Iranian territories in 905/1500 including Iraq and founded the Safavid empire. In Iran, he absolutely dominated in Hamdan, Mazandaran, Shirwan, Khorasan, Yazd etc. He tried to extend his influence in Afghanistan, Balkh and Bukhara. The Ottoman empire evidently opposed the growing power in Iran. The Uzbek rulers of Bukhara however checked the advance of the Safavids. Thus, the Safavids considered their two borders insecure for the empire.
Shah Ismail's fist action on his accession was the proclamation of the Shiism as the state religion of Iran, differentiating from the Ottoman of Turkey, who were the Sunnis. Shah Ismail however failed to impose Shiism in many Iranian regions. Many people are reported to have been executed, and other migrated. The Sunni theologians went to Herat, India and Bukhara. Under such rigorous policy, one renowned Ismaili scholar, Shah Tahir Hussain Dakkani also fled from Kashan, and repaired to India. The Sufis were also not spared in Iran, who began to live under the cloak of the Twelvers.
The strict Shiite tendency in Iran had certainly forced the Ismailis to assume the mantle of the Twelvers to get rid of the executions. Weathering these stroms, it seems that Imam Abuzar Ali had gone into hiding for about seven years between 905/1500 and 912/1507, which can be ascertained also from the version of Khayr Khwah Herati's "Tasnifat" (ed. W.Ivanow, Tehran, 1961, p. 52). Before leaving Anjudan for an unknown place, he had most possibly left behind his hujjat to act as a link between the Imam and the followers.