Hasan Damghani was now forced to deal with Amir Vali, who was a son of the former governor of Astarabad before its conquest by the Sarbadars. Amir Vali had taken advantage of Haidar Qassib's move out of Astarabad to return to the city. Amir Vali then claimed to be acting in the name of Luqman, the son of Togha Temur, although he never handed power over to him. Hasan sent two expeditions against him, both of which ended in failure; he himself led a third force, but met no more success, allowing Amir Vali to be in a position to gain more Sarbadar territory. Meanwhile, in the east a radical Shi'i named Darvish 'Aziz revolted and established a theocratic state in Mashhad in the name of the Twelfth Imam. Darvish 'Aziz gained more territory with his conquest of Tus. Hasan recognized that the entire Sarbadar state was in jeopardy: the Sabzavari dervishes might declare their support for the theocratic state at any time. He moved against Darvish 'Aziz, defeated him and destroyed the Mahdist state; Darvish 'Aziz went to Isfahan in exile. Soon afterward, however, an 'Ali-yi Mu'ayyad rose in revolt in Damghan and gained the support of Hasan's enemies. He recalled Darvish 'Aziz from exile and joined his order. While Hasan was besieging the castle of Shaqqan, near Jajarm, 'Ali-yi Mu'ayyad captured Sabzavar around 1361. In the process, he captured the possessions and families of many of Hasan's followers. When he demanded Hasan's head, they therefore complied.