By 1090 AD, the Seljuq vizier Nizam al-Mulk had already given orders for Hassan's arrest and therefore Hassan was living in hiding in the northern town of Qazvin, approximately 60 km from the Alamut castle.
There, he made plans for the capture of the fortress, which was surrounded by a fertile valley whose inhabitants were mainly fellow Shi’i Muslims, the support of whom Hassan could easily gather for the revolt against the Seljuqs.
The castle had never before been captured by military means and thus Hassan planned meticulously.
Meanwhile, he dispatched his reliable supporters to the Alamut valley to begin settlements around the castle.

In the summer of 1090 AD, Hassan set out from Qazvin towards Alamut on a mountainous route through Andej.
He remained at Andej disguised as a schoolteacher named Dehkhoda until he was certain that a number of his supporters had settled directly below the castle in the village of Gazorkhan or had gained employment at the fortress itself.
Still in disguise, Hassan made his way into the fortress, earning the trust and friendship of many of its soldiers.
Careful not to attract the attention of the castle's Zaydi ‘Alid lord, Mahdi, Hassan began to attract prominent figures at Alamut to his mission.
It has even been suggested that Mahdi's own deputy was a secret supporter of Hasan, waiting to demonstrate his loyalty on the day that Hasan would ultimately take the castle.

Earlier in the summer, Mahdi visited Qazvin, where he received strict orders from Nizam al-Mulk to find and arrest Hassan who was said to be hiding in the province of Daylaman.
Upon his return to the Alamut fortress, Mahdi noticed several new servants and guards employed there.
His deputy explained that illness had taken many of the castle's workers and it was fortunate that other labourers were found from the neighbouring villages.
Worried about the associations of these workers, Mahdi ordered his deputy to arrest anyone with connections to the Ismailis.

Mahdi's suspicions were confirmed when Hassan finally approached the lord of the fortress, revealing his true identity and declared that the castle now belonged to him.
Immediately, Mahdi called upon the guards to arrest and remove Hasasn from the castle, only to find them prepared to follow Hasan's every command.
Astounded, he realized he had been tricked and was allowed to exit the castle freely.
Before leaving however, Mahdi was given a draft of 3000 gold dinars as payment for the fortress, payable by a Seljuq officer in service to the Isma'ili cause named Ra’is Muzaffar who honoured the payment in full.
The Alamut fortress was captured from Mahdi and therefore from Seljuq control by Hasan and his supporters without resorting to any violence.
By 1090 AD, the Seljuq vizier Nizam al-Mulk had already given orders for Hassan's arrest and therefore Hassan was living in hiding in the northern town of Qazvin, approximately 60 km from the Alamut castle. There, he made plans for the capture of the fortress, which was surrounded by a fertile valley whose inhabitants were mainly fellow Shi’i Muslims, the support of whom Hassan could easily gather for the revolt against the Seljuqs. The castle had never before been captured by military means and thus Hassan planned meticulously. Meanwhile, he dispatched his reliable supporters to the Alamut valley to begin settlements around the castle.
In the summer of 1090 AD, Hassan set out from Qazvin towards Alamut on a mountainous route through Andej. He remained at Andej disguised as a schoolteacher named Dehkhoda until he was certain that a number of his supporters had settled directly below the castle in the village of Gazorkhan or had gained employment at the fortress itself. Still in disguise, Hassan made his way into the fortress, earning the trust and friendship of many of its soldiers. Careful not to attract the attention of the castle's Zaydi ‘Alid lord, Mahdi, Hassan began to attract prominent figures at Alamut to his mission. It has even been suggested that Mahdi's own deputy was a secret supporter of Hasan, waiting to demonstrate his loyalty on the day that Hasan would ultimately take the castle.
Earlier in the summer, Mahdi visited Qazvin, where he received strict orders from Nizam al-Mulk to find and arrest Hassan who was said to be hiding in the province of Daylaman. Upon his return to the Alamut fortress, Mahdi noticed several new servants and guards employed there. His deputy explained that illness had taken many of the castle's workers and it was fortunate that other labourers were found from the neighbouring villages. Worried about the associations of these workers, Mahdi ordered his deputy to arrest anyone with connections to the Ismailis.
Mahdi's suspicions were confirmed when Hassan finally approached the lord of the fortress, revealing his true identity and declared that the castle now belonged to him. Immediately, Mahdi called upon the guards to arrest and remove Hasasn from the castle, only to find them prepared to follow Hasan's every command. Astounded, he realized he had been tricked and was allowed to exit the castle freely. Before leaving however, Mahdi was given a draft of 3000 gold dinars as payment for the fortress, payable by a Seljuq officer in service to the Isma'ili cause named Ra’is Muzaffar who honoured the payment in full. The Alamut fortress was captured from Mahdi and therefore from Seljuq control by Hasan and his supporters without resorting to any violence.
Alamut Castle