Tradition has it that Imam Muhammad bin Ismail left Medina and went to southern Iraq, where he acquired the epithet of al-maktum (veiled one), and then at Nishapur in disguise, where he lodged for some times. Afterwards, the Imam proceeded towards Ray, about 15 miles from Tehran. Ishaq bin al-Abbas al-Farsi, the Abbasid governor of Ray professed Ismailism. Imam betrothed to Fatima, the daughter of Sarah, sister of Ishaq bin al-Abbas. When the news of Imam Muhammad bin Ismail’s stay at Ray reached the ears of Harun ar-Rashid, he wrote to Ishaq bin al-Abbas, ordering to arrest the Imam and send him to Baghdad. Upon receipt of caliph’s letter, he showed it to the Imam and replied to the caliph that he found no trace of the Imam, and would send as soon as he was arrested, and thus he tried to put the caliph off the scent. But the spies planted by Baghdad reported to the caliph that Imam Muhammad bin Ismail not only was living at governor’s house, but that he was operating his mission from there. Upon this, the caliph wrote another letter to Ishaq bin al-Abbas, impugning him to come in person with his forces if his orders were not obeyed forthwith. The governor however made his usual reply. Meanwhile, the complaints about Ali bin Musa bin Mahan, the governor of Khorasan reached the point where Harun ar-Rashid could no longer ignore them, and adopted a militant stance. In 189/805, he marched towards Ray with a detachment of his army, and after searching for the Imam through a tracking party, ordered to arrest Ishaq bin al-Abbas. Ishaq died as a result of severe torture inflicted upon him, and was rigorously flogged till death. He did not waver and stood steadfast in spite of excruciating tortures. In spite of the gloomy situation, his faith remained unshakable.
Imam Muhammad bin Ismail selected Hurmuz as a mission centre, and then had made his footing at the fortified city of Nihawand, where he stayed with the governor, Mansur bin Jowshan, who had close ties with Ishaq bin al-Abbas. He allotted the Imam a piece of land in the district of Sarha, where he led a peaceful living. It is related that the Abbasid agent, named Muhammad bin Ali al-Khorasani, who surprised the Imam in a mosque, traced the Imam out on one day in Sarha. He was greatly impressed to behold the Imam, and lost courage to arrest him, and permitted the Imam to escape. Thence, the Imam went to Azar in Khuzistan. The Imam then proceeded to Shapur. Disguised as a merchant, he stayed in Shapur with a certain Qamas bin Nuh, whose daughter Rabta, he married. When the Abbasids intensified their search for the Ismaili Imam to its extreme, Imam Muhammad bin Ismail had to travel out of Iran
Imam Wafi Ahmad came to settle down in Nihawand, and betrothed to Amina, daughter of Hamdan, son of Mansur bin Jowshan, who was from Kazirun. The brother of Wafi Ahmad also married here and had a posterity. Imam Wafi Ahmad further on repaired to Daylam with his 32 trusted da’is, where he got married with an Alid lady in the village of Ashnash. The adoption of strict taqiya, and moving from one to another place, forced the Imam to assign the mission works to his brother, Hussain bin Muhammad. It is most possible that Imam Wafi Ahmad lived in Suk al-Ahwaz for a short period.