[4] At the time of Ya'qub's death, Sufi Khalil found himself in a favourable position as the head of the political and military preponderance in the winter quarters of Qarabagh.
Now de facto ruler of the realm, Sufi Khalil had Ya'qub's chief of staff, Mirza Ali ibn Sultan-Khalil, captured and executed.
A bloody battle subsequently ensured in the royal camp, which led to the elimination of the Bayandur princes and officers, including Ya'qub's brother Masih Mirza.
Ya'qub's nephew Rustam Beg was captured and imprisoned in the Alinjaq castle near the city of Nakhjavan, while Mahmud ibn Ughurlu Muhammad managed to escape to the province of Arabian Iraq, which was under Purnak control.
In order to further consolidate his rule, Sufi Khalil now went against the rest of the administration of Ya'qub, including the powerful bureaucrat Qazi Isa Savaji, whose reforms hurt the economic support that the Turkoman military leaders enjoyed.
[8] Qazi Isa's nephew Najm al-Din Mas'ud Savaji managed to escape for a short while, until he was poisoned by Mulla Jan at the instigation of Sufi Khalil.
In the city of Hamadan, Shah-Ali Beg Purnak, who had served as the governor of Arabian Iraq for a long time under Ya'qub, declared the Aq Qoyunlu prince Mahmud ibn Ughurlu Muhammad as sultan.
[12] Sufi Khalil was also opposed by Sulayman Beg Bijan in Diyar Bakr, a long-time rival of his, who was the guardian, father-in-law, and former chief of staff of Ya'qub.