After the assassination of Jahan Shah on November 10, 1467, Hasanali attempted to restore Qara Qoyunlu rule in the south of Azerbaijan but was killed in 1469 before achieving this goal.
After spending the winter of 1466 in Tabriz, Jahan Shah undertook a successful campaign into Shirvan, plundering the regions as far as Derbent.
In response, Uzun Hasan sent an envoy, Qazi Ruknuddin Ali, with a letter filled with respectful and appreciative words, along with valuable gifts, back to Jahan Shah.
After convening a military council, Jahan Shah decided to postpone the main battle until the following year and sent his family to Tabriz with a portion of his army.
The spy entered Jahan Shah's headquarters without any difficulty, loudly shouting to inquire if anyone had seen a lost horse, but received no response.
Understanding that the situation was favorable, Hasan Beg launched a surprise attack on Jahan Shah's headquarters in the early morning hours of November 10, 1467, with a force of 6,000 soldiers.
Simultaneously, the daughters of Qara Iskender, Arayish and Shahsaray Beyim living in Tabriz, declared Hasanali as the new sultan.
[3] Although Hasanali could amass a large army against Uzun Hasan, his actions of killing influential commanders and relatives during his ascent to the throne undermined his influence.
Prominent Qara Qoyunlu commanders like Shahmansur, Shahsuvar Bey, and Amir Ibrahimshah switched sides to support Uzun Hasan.
[13] After the death of Hasanali in 1468, Yusif Mirza, who had served as the Amir-ul-umara and vizier of Qara Qoyunlu Jahan Shah, was proclaimed the new sultan by Pireli Beg Baharli.