Ahi Ayna

Ghiyath al-Din Ahi Ayna Beg (Yaxiayna Bēk; Αχχὴς Ἀϊναπάκ; ; died 2–3 July 1362) was Emir of Erzincan from 1348 until his death. Thought to be a local ahi (guild member), he gained control of the region and the city of Erzincan in northeastern Anatolia through a purchase from his unknown predecessor sometime before 1348. He was initially loyal to Eretna ((r. 1343 – 52)), a former Ilkhanate officer who forged his own sovereign state. After Eretna's death, Ahi Ayna practiced some degree of autonomy within the Eretnid Sultanate. He waged multiple wars against the neighboring Christian states, the Empire of Trebizond and the Kingdom of Georgia. He is recorded to have died a shaheed (martyr) and was succeeded by Pir Husayn.

Background
Following the retreat of the Byzantine Empire from much of Anatolia after the Battle of Manzikert, the Mengüjekids rose in the region around Erzincan in the early 12th century. It later came under the influence of the Sultanate of Rum, an Islamic state centered in Anatolia, which saw its height from the late 12th century to 1237. The Mongol invasion gradually reached the region. Mongol raiders led by Baiju Noyan pillaged Erzincan and reached until Sivas in 1232. The Sultan of Rum, Kaykhusraw II ((r. 1237 – 46)) suffered a major defeat by the Mongol Empire at the Battle of Köse Dağ in 1243. With the division of the Mongol Empire, the Ilkhanate, founded by Hulegu Khan ((r. 1256 – 65)), rose in West Asia. A Christian remnant of the Byzantine Empire, the Empire of Trebizond, was located north of Erzincan. Although Trebizond did not rule over Erzincan, the town had significant commercial links with Trebizond, being mostly inhabited by Christian Armenians but administered by a Muslim ruler. At an unknown date in the first half of the 14th century, Erzincan came under the rule of Eretna ((r. 1343 – 52)), a former Ilkhanid officer who carved up his sultanate after the downfall of the Ilkhanate. After his victory in 1343 at Karanbük (between Erzincan and Sivas) against the Chobanid army led by Suleiman Khan, Eretna declared independence as the sultan of his domains, minting his own coins and having the khutbah (sermon) delivered in his name.

Reign
A local Muslim and ahi (guild member), Ahi Ayna (Yaxiayna Bēk; Αχχὴς Ἀϊναπάκ; ) purchased control of Erzincan from his predecessor sometime before 1348 according to the Bazm u Razm, written by Aziz bin Ardashir-i Astarabadi in 1398. Ahi Ayna first appears in 1348 as a vassal of Eretna. The contemporary Trapezuntine historian Michael Panaretos wrote that in June 1348, Ahi Ayna led a joint attack against the Empire of Trebizond together with Tur Ali Beg of the Aq Qoyunlu Turkmens and Muhammad Rikabdar, the emir of Bayburt. Ahi Ayna returned to Erzincan after three days of campaigning proved inconclusive.

Following Eretna's death, Ahi Ayna was left with more autonomy within the Eretnids 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, Ahi Ayna went on an expedition in Georgia. He captured Akhaltsikhe, Samstskhe, and Atsquri, took 12,000 people captive, and had Manglisi pay jizya (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 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 the Upper Euphrates Valley near Çaltı. Kemah was under the direct administration of an Eretnid governor instead of a vassal emir of the Eretnids like Ahi Ayna. Although Ahi Ayna acted semi-independently during the reign of Ghiyath al-Din Muhammad I ((r. 1352 – undefined)) 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 shaheed (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. Pir Husayn "gained independence" on 10 July, having clashed with emirs who fled to Bayburt and Tercan. In Tarikh-i taqwim by the fourteenth-century writer Abu Bakr al-Qutbi, 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. During his reign, Ahi Ayna Beg built a takya (building for Sufi gatherings) known after himself in the city of Erzincan.