According to Serebrov, upon hearing of Fath Ali Khan's death, Muhammad Hasan Khan seized the opportunity to install Manaf Zarnavai, son of
Hajji Muhammad Ali, whom he recognized as rightful heir, in Shamakhi. He raised troops, marched on Shamakhi, forced
Ahmad Khan to leave, installed Manaf as khan, and returned. Manaf ruled only 15 days. Soon Askar Khan arrived with armies of Karabakh and captured Manaf, and executed him to secure their claim. However,
Bakikhanov offers another version of this event. According to him, Manaf was dispatched alongside Shirvani princes. Khan of Shaki installed Manaf in New Shamakhi, while Askar Khan was installed as a khan among nomads (). Manaf's rule lasted a week after Shaki armies left the region. Askar Khan became Khan while Mustafa went to his father's former base
Alvand. According to Serebrov, Ahmad Khan made repeated attempts to retake Shamakhi, however, he reconciled with him through the mediation of Haji Ahmet, the ruler of
Dzhengutay. Bakikhanov gives more background on this event - according to him, Muhammad Hasan Khan had taken offence over the killing of his appointee Manaf Khan. He sent an envoy to Quba Khanate and forged an alliance to attack against Shirvan. Both armies besieged New Shamakhi eventually, but the siege dragged on for quite some time, and the heat grew intense. Askar Khan, in secret, sent 5,000
tomans in cash and goods to the Dagestanis (presumably, the Dzhengutay) within Muhammad Hasan Khan's army. As a result, discord broke out within the allied forces. == Fall from power ==