Ahi Ayna and Pir Husayn (1348–1379) 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 1361, Ahi Ayna went on an expedition in the
Kingdom of Georgia. He captured
Akhaltsikhe,
Samstskhe, and
Atsquri, took 12,000 people captive, and had
Manglisi pay (special tax on non-Muslims). On 6 August 1361, Ahi Ayna continued his expedition in the region of
Lazica, i.e., the eastern territories of the Empire of Trebizond. In October of that year, he besieged but could bnot 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, 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 () 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 Husayn 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 available accounts of the period until Pir Husayn's death in 1379.
Mutahharten (1379–1403) Mutahharten took power upon Pir Husayn's death in 1379. He struck his own coins and had the (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 the same year. Mutahharten initially faced defeat in a bloody battle and retreated but still resisted coming under Eretnids, who subsequently faced a major loss. Kadi Burhan al-Din's () rise to power as the regent of Ali's successor
Muhammad II Chelebi (), 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 (). However, their 2,000-strong force was soon overpowered by Burhan al-Din, who sent latter's head to Erzincan in 1381 as a warning to Mutahharten. 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. However, Burhan al-Din reached Erzincan and razed parts of the city to the ground but was unable to capture the city with winter beginning in 1384–1385. 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. In late 1386,
Timur (), 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. 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–1388. In 1387, Mutahharten reported Burhan al-Din to the
Mamluk Sultan Barquq () 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. Upon the news of another Timurid expedition in 1393–1394, 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 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 (). 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 emerged victorious there, Burhan al-Din continued pursuing Mutahharten until Qara Yuluk killed Burhan al-Din on 14 July 1398. The
Ottoman sultan Bayezid I () 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 briefly 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 legitimate male issue.
Fall Exact details on the emirate's end following Mutahharten's demise are obscure.
Castilian traveler
Ruy González de Clavijo claimed that Mutahharten's daughter's son, Sheikh Ali, first gained control of the city, and after Timur's intervention, Mutahharten's son usurped the throne, although Mutahharten lacked legitimate heirs. According to Clavijo, the city of Erzincan was besieged by the Qara Qoyunlu ruler Qara Yusuf in 1406. However, no other contemporary sources provide a similar account. Iranian historian
Hafiz-i Abru noted that in 1410, Mutahharten's other grandson Sheikh Hasan surrendered after resisting a 45-day siege led by Qara Yusuf. Qara Yusuf appointed one of his adherents, Pir Umar, as the governor of Erzincan. Sheikh Hasan was granted control of a fortress near Erzurum, thus putting an end to the emirate. Historian Rustam Shukurov identifies Mutahharten's grandson "Yar Ali" as the emir or governor between 1403–1410 and 1420–1425. ==Culture and economy==