# Hasan Ali (Qara Qoyunlu)

Hasanali, also known as Sultan Hasanali or Hasanali Beg (Azerbaijani: حسن‌علی بیگ; Persian: حسنعلی بیگ; died 1468) — was the last sultan of the Qara Qoyunlu state and the son of Jahan Shah Haqİqi. 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.

## Rebellions

He was a son of Jahan Shah and several times imprisoned by his father due to his rebellious nature. He rebelled in 1458, but upon hearing Jahan Shah's return from Herat, he fled to Maku. After being granted amnesty due to his mother, he joined Uzun Hasan. However, he was banished soon after and joined his brother Pirbudag in Isfahan. Brothers rebelled again in 1459. They were crushed and again granted amnesty by Jahan Shah who was under influence of their mother. Their final rebellion in 1464 was disastrous, Pir Budaq was executed and Hasan Ali was again imprisoned in Maku.

## Reign
### Jahanshah's death

After spending the winter of 1466 in Tabriz, Jahan Shah undertook a successful campaign into Shirvan, plundering the regions as far as Derbent. At this time, the territories of the Qara Qoyunlu state included Azerbaijan, Aran, Iraq-i Ajam, Iraq-i Arab, Fars, Kerman, and Eastern Anatolia. The rulers of Georgia, Shirvan, Gilan, and Mazandaran also acknowledged his authority.
During Uzun Hasan's reign, Jahan Shah experienced the most tense period in his relations with the Aq Qoyunlu. Uzun Hasan took advantage of Jahan Shah's military operations in the eastern part of Iran, successfully capturing several territories in response to Jahan Shah's main goal of taking control of Azerbaijan. In retaliation, after spending the winter of 1466 in Tabriz, Jahan Shah sent troops to Anatolia to confront Uzun Hasan. On May 16, 1467, Jahan Shah reached Shakhmanabad near Lake Van, and negotiations commenced between the two rulers. Jahan Shah sensed Uzun Hasan's strategy of avoiding direct confrontation and rejected his positive promises. 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. His goal was to minimize the perception of avoiding battle and to promote the Aq Qoyunlu's strength. The envoy conveyed on behalf of Uzun Hasan to Jahan Shah:
   Our lord is loyal and devoted to you. If your goal is to take control of the country, he is ready to provide you with the keys to all the fortresses. If you desire wealth, he is willing to offer his entire state to you.
Jahan Shah rejected these offers because his main objective was to eliminate the overall threat of Uzun Hasan. The two sides met for the first time face-to-face on November 11 in the plains of Mush. In the clash between the vanguard forces of the Aq Qoyunlu and Qara Qoyunlu, the Qara Qoyunlu forces were defeated. 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. He himself established a camp in Bingol but took no necessary precautions for security, seemingly ignoring the danger. Uzun Hasan, on the other hand, perceived these actions of his adversary as possibly related to some military activities. When messengers informed him otherwise, he began preparing specific steps for the upcoming battle and improved intelligence materials. After identifying the location of his opponent in the Sanjaq region, he sent a spy disguised as a villager to his headquarters. 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. Observing that all the soldiers in that camp were intoxicated, he informed Hasan Beg. 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. The Qara Qoyunlu forces, unable to display any resistance, scattered. Jahan Shah was killed by a soldier, his two sons and all his nobles were captured. Later, his body was transported to Tabriz and buried in the mausoleum he had built there, known as the Muzaffariyya Mausoleum.

### Ascended the throne

After the death of his father, Hasanali was released from captivity and proclaimed as the sultan by some commanders. Following his ascent to the throne, he invited Teymur Abu Saeed Mirza to join his army and march against Uzun Hasan. Simultaneously, the daughters of Qara Iskender, Arayish and Shahsaray Beyim living in Tabriz, declared Hasanali as the new sultan. Hasanali's brother Qasim Mirza, who governed Kerman, also revolted. Hasanali quelled all opposition, sentencing Qasim Beg, his stepmother Jan Beyim, and uncles Qasim and Hamza to punishment.
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. Uzun Hasan easily began to take control of Karabakh and South Azerbaijan.
In the battle near Khoy in 1468, despite having a sizable army, the Qara Qoyunlu forces were defeated. Hasanali fled to Barda and sought refuge with the Qaramanli tribe. Uzun Hasan's heir, Ugurlu Muhammad, captured him and sentenced him to punishment. According to Faruk Sumer, Hasanali actually committed suicide.

## After

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. Shortly thereafter, Hasanali's son Sultanali and Prince Mahmud Beg (son of Qara Yuluq Osman and a rival of Uzun Hasan) also joined him. Despite achieving some successes in Luristan, they were defeated by Uzun Hasan and withdrew to Shiraz. Yusif Mirza was assassinated by Ugurlu Muhammad on October 22, 1469. Pireli Beg Baharli sought refuge in the court of Timurid Hussein Bayqara.