Emirate of Erzincan

The Emirate of Erzincan was an emirate that controlled much of Eastern Anatolia in the fourteenth and early fifteenth centuries.

Ahi Ayna (1348–1362)
A local ahī, Ahi Ayna purchased control of Erzincan from his predecessor sometime before 1348. Ahi Ayna first appears in records as a vassal of Eretna circa 1348. Michael Panaretos wrote that in June 1348, Ahi Ayna led a joint attack against the Empire of Trebizond together with Tur Ali Beg of Aq Qoyunlu Turkmens and Muhammad Rikabdar, Emir of Bayburt. He returned to Erzincan after 3 days of campaign was inconclusive.

Following Eretna's death, Ahi Ayna exercised autonomy and attempted to increase his sphere of influence. An Armenian colophon of 1355 mentions that Ahi Ayna was attacked by "Khochay Yali," likely Khoja Latif of Bayburt. In June 1362, Ghiyath al-Din Ahi Ayna Beg went on an expedition in Georgia. He captured Akhaltsikhe, Samstskhe, and Atsquri, took 12,000 people captive, and had Manglisi pay jizya. On 6 August 1361, Ahi Ayna continued his expedition in the region of Lazica, i.e. eastern territories of the Empire of Trebizond. In October of that year, he besieged but wasn't able to capture the fortresses of Golacha and Koukos.

Ahi Ayna was the suzerain of three other emirates, namely those in Erzurum, Bayburt, and Karahisar. His core territory stretched from the Erzincan Plain southwards to Upper Euphrates Valley near Çaltı. Kemah was under the administration of a governor instead of a vassal emir like Ahi Ayna. Although Ahi Ayna acted semi-independently during the reign of Ghiyath al-Din Muhammad I of the Eretnid Sultanate, an Eretnid coin minted in Erzincan from the year 1359 indicates that Ahi Ayna's subordinate position continued and he never declared independence. Ahi Ayna died on 2–3 July 1362 reportedly as a shahīd (martyr), suggesting a violent death.

Pir Husayn (1362–1379)
Pir Husayn, who was originally the ruler of Karahisar, arrived in Erzincan on 8 June 1362 and succeeded Ahi Ayna Beg. In Abu Bakr Qutbi's Ta'rīkh-i taqwīm, he is mentioned as an emīr-zāda (lit. 'son of an emir') following the statement about Ahi Ayna's demise, hinting at the possibility he was Ahi Ayna's son.

Pir Husayn's ascendance to the throne was not straightforward as Erzincan was in the midst of a civil war. He "gained independence" on 10 July, having clashed with emirs opposing his rule, who eventually fled to Bayburt and Tercan. On 11 September, he gained control of Bayburt after a 32-day siege.

Although there is a coin specimen minted in Erzincan for Ala al-Din Ali dating back to 1366, Pir Hsayn most likely exercised further autonomy, especially following the temporary political vacuum caused by Ghiyath al-Din Muhammad I's death in 1365. However, there aren't any sufficient accounts of the period until Pir Husayn's death in 1379.

First war with the Eretnids and Kadi Burhan al-Din
Mutahharten took power upon Pir Husayn's death in 1379. He issued his own coins and had the khutbah (sermon) read in his name as a declaration of his sovereignty. Although the Eretnid vizier Kadi Burhan al-Din opposed an immediate campaign, the Eretnid sultan Ali began marching towards Erzincan in the summer of 1379. Mutahharten initially faced defeat in a bloody battle and retreated but still resisted coming under Eretnid rule. He sought the help of external powers, such as the Dulkadirids and Aq Qoyunlu, who sent a large army to Erzincan. The Eretnids subsequently faced a major loss, and Ali retreated to Sivas.

Kadi Burhan al-Din's ((r. 1381 – 98)) rise to power as the regent of Ali's successor Muhammad II Chelebi ((r. 1380 – 81)), and his aim at re-imposing authority over the region, prompted Mutahharten to form alliances with Burhan al-Din's rivals and other claimants to the Eretnid throne, such as Shadgeldi, Emir of Amasya ((r. 1359 – undefined)). Mutahharten further built amicable relations with several vassals of Burhan al-Din. While Shadgeldi was besieging Tokat, Mutahharten and his allies pushed into Burhan al-Din's domains. However, their 2,000-strong force were eventually defeated by Burhan al-Din. Mutahharten sent an embassy to Burhan al-Din, demanding that he return the throne to Ali's son, Muhammad II Chelebi, who was too young to rule. Burhan al-Din later imprisoned Mutahharten's embassy, which caused Mutahharten to change his stance, sending apologies and offering an alliance instead. Although Kadi Burhan al-Din released his embassy, he sent Shadgeldi's head to Erzincan in 1381 as a warning after having defeated him on the battlefield. The same year, Kadi Burhan al-Din formally declared his sultanate.

Allied with several Mongol and Turkmen chieftains, Mutahharten went on another campaign on Sivas. After having dealt with his rivals in the northern region around Amasya, Tokat, and Osmancık until spring 1383, Burhan al-Din focused on his struggle east against Mutahharten. The latter received Aq Qoyunlu aid, headed by Ahmad Aq Qoyunlu ((r. 1389 – 1403)), leading an initially successful joint offensive. Conversely, Burhan al-Din reached Erzincan and razed parts of the city to the ground but was unable to capture the city with winter creeping in (1384–5). Burhan al-Din's return to Sivas marked the end of the long war between him and Mutahharten. They agreed to recognize each other's sovereignty and to refrain from getting involved in each other's internal relations. Mutahharten was further obliged to send military aid to Kadi Burhan al-Din in times of war.

Advent of Timur
In late 1386, Timur ((r. 1370 – 1405)), a Turco-Mongol warlord who attempted to invoke the legacy of Genghis Khan, invaded west Iran and was planning his invasion of the Armenian highlands from his military camp in Karabakh. When Timur's embassy arrived in Erzincan, Mutahharten swiftly agreed to refrain from joining opposition forces and to abide by Timur's rule, which reduced his fears of a direct Timurid attack. Timur recognized Mutahharten's domains through an exchange of gifts. Although Mutahharten halted his campaigns in Anatolia during this time, Timur's presence was favored by him and other enemies of Burhan al-Din.

When Timur's focus shifted away from the region, Mutahharten used the Qara Qoyunlu Turkomans who took refuge in his territory in an expedition in Burhan al-Din's lands, taking advantage of Burhan al-Din's absence as he was dealing with the local Turkoman principalities to the north. Burhan al-Din returned to Sivas when he learned that Mutahharten was marching there, prompting Mutahharten to stop the campaign in the winter of 1387–8. In 1387, Mutahharten reported Burhan al-Din to the Mamluk Sultan Barquq ((r. 1382 – undefined)) as an ally of Timur, which initiated a joint campaign with the Mamluks on Sivas that lasted until the Mamluks retreated from the region in 1389.

Mutahharten broke the alliance with the Aq Qoyunlu upon the death of Qutlugh ((r. 1362 – 89)) and the succession of his son Ahmed ((r. 1389 – 1403)). Mutahharten was ultimately overpowered on the battlefield. This prompted him to seek the assistance of Qara Mahammad ((r. 1380 – 89)) of the Qara Qoyunlu. They flanked the Aq Qoyunlu forces, who took refuge under Burhan al-Din. Shortly after, Mutahharten and Qara Yusuf ((r. 1389 – 1420)), Qara Mahammad's son and successor, planned a major war on the Aq Qoyunlu, but were defeated near Endris. Qara Yusuf was captured, and Mutahharten fled to Erzincan. The latter prepared for a counter-attack in Shamsat (located between Harpoot and Bayburt) and reentered Aq Qoyunlu territory. He stationed his army on the right bank of Murat River near the town of Gulushkerd, confronting the Aq Qoyunlu forces on the opposite side. Although Ahmad Aq Qoyunlu wanted to make peace with Mutahharten, to whom his daughter was married, Mutahharten was defeated a second time at the hands of Ahmad's brother, Qara Yuluk ((r. 1378 – 1435)).

Upon the news of another Timurid expedition in 1393–4, Mutahharten reaffirmed his allegiance to Timur. He acted as an ambassador during Timur's siege of Avnik. The author of Bazm u Razm, Astarabadi, who was hostile to Mutahharten, described his actions during this period as cowardly. Astarabadi claimed that Mutahharten stopped administering his region altogether. After allegedly kissing Timur's stirrup, Mutahharten changed the name on his coins and the khutba to Timur's and tried to provoke him to invade all of Anatolia and Syria. However, Timur left Mutahharten without a liege when he departed for Georgia to subdue Tokhtamysh of the Golden Horde ((r. 1379 – undefined)).

In retribution for Mutahharten's allegiance to Timur, Burhan al-Din took the fortresses of Ezdebir, Sis, and Burtulush. Though, when he departed for Sivas, the guards of these fortresses betrayed him and surrendered control to Mutahharten. With the support of Ahmad Aq Qoyunlu, Burhan al-Din decimated the region of Erzincan for a whole month and granted the Aq Qoyunlu the territory around Bayburt. On 27 October 1395, Mutahharten clashed with Burhan al-Din at Pulur. Although Mutahharten came out victorious there, Burhan al-Din continued to pursue Mutahharten until Burhan al-Din was killed by Qara Yuluk on 14 July 1398.

Ottoman–Timurid conflict
The Ottoman sultan Bayezid I ((r. 1389 – 1402)) annexed Sivas in 1398 and demanded that Mutahharten accept his suzerainty. Instead, Mutahharten relied on Timur, who conquered Sivas in August 1400. Bayezid did not shy away from striking back and advanced as far as Erzincan in 1401, where he took Mutahharten and his Trapezuntine wife captive. Mutahharten was ultimately released and restored as the ruler when Qara Yusuf, who had been given control of the place, did not fare well with the locals. Mutahharten momentarily acted as an intermediary between the Ottomans and the Timurids, but soon participated in the latter's Anatolian campaign that would become a major blow to the Ottomans at the Battle of Ankara. Mutahharten died in late 1403. He had no surviving male issue.

Culture
Ahi Ayna is known to have built a takya (building for Sufi gatherings) known after himself in the city of Erzincan. Mutahharten's legacy in Erzincan includes a madrasa (school) and zawiya (Sufi building). During the period of the emirate, Erzincan was the scene of literary exchange and production. Sati ibn al-Hasan, a well-respected lord and history-writer from Erzincan, is thought to have sourced the paper from Damascus, paying 6000 dirhams, for his work titled Tarikh-i Chingiz Khan (lit. 'the history of Genghis Khan'), which also went through the binding process in Hama before arriving in Erzincan. A copy of Rumi's Masnavi prepared by Muhammad ibn Husayn al-Mawlawi in January–February 1373 probably in Erzincan for "Taj al-Din Shaykh Husayn Beg" is attributed to Pir Husayn's patronage.

List of rulers

 * Ahi Ayna (1348–1362)
 * Pir Husayn (1362–1379)
 * Mutahharten (1379–1403)