Treaty of Hamedan

The Treaty of Hamedan was a treaty between the Ottoman Empire and the Hotaki dynasty signed in October 1727 in Hamedan, ending the Ottoman–Hotaki War (1726–1727).

Background
As Ottoman expansion into Persia continued, Ashraf Hotak, having recently toppled his brother, Mahmud Hotak from power, was claiming himself as the sole legitimate ruler of all Persia, and demanded that the Ottomans cede all their annexed territories. Ashraf also claimed himself as the Sunni caliph. The Ottomans saw this as a diplomatic insult, and broke off all ties, and declared war on the Afghans. One of the main goals of the Ottomans was to restore the Safavid dynasty as a vassal state to the throne. And as a result, Ashraf Hotak executed Soltan Hoseyn, the former Safavid king. War began as the Ottomans opened hostility in the Azerbaijan region in 1726.

Terms of the treaty
Preferring to not push onward due to internal issues and the state of the Afghan army, Ashraf Hotak began negotiating a peace agreement. The Hotaks had obtained a military victory in this engagement against the Ottomans. Ashraf Hotak was also officially recognized as Shah, with the Ottomans corresponding him as the Shah of Iran. Alongside this, Pilgrimage caravans sent by the Afghans would be protected by the Ottomans. The Ottomans made political gains after successfully negotiating to keep their occupied lands. The Afghans withdrew from territories gained following their victories, with the Ottomans taking control of Zanjan, Soltaniyeh, and Abhar.

Aftermath
The war allowed Ashraf Hotak to unite and gain support from his Kurdish and Zoroastrian populations, and even Shia Shahsevan tribes. Nonetheless, the Afghans were still in great majority, seen as usurpers by the Iranian populace. As a result, this sparked internal revolts and weakened the strength of the Afghans and their administration based in Isfahan. And as a result, the rise of Nader Shah began. After numerous engagements, the Afghan armies were forced back on Isfahan, with them abandoning the city on 21 November 1729.