Muhammad I of the Eretnids

Ghiyath al-Din Muhammad I (died October 1365) was the second Sultan of the Eretnids in central and eastern Anatolia, ruling from 1352 until his death. He was enthroned at a young age and struggled to maintain his authority over the state his father, Eretna, had founded. Although he was initially preferred over his older brother Jafar, Muhammad was deposed by his emirs early into his reign and was replaced by Jafar. After some time in exile, he returned, restored his throne, and killed his brother. Though, throughout his reign, he dealt with rebellions and lost land to local Turkoman lords, the Dulkadirids, and the Ottomans. After putting an end to his former vizier Khoja Ali Shah's revolt and returning to the capital, Kayseri, Muhammad was murdered by his emirs, who crowned his son Ali as the new sultan.

Early life and background
Muhammad was born to Eretna and Isfahan Shah Khatun. His mother, Isfahan Shah Khatun, was a relative of the Jalayirid ruler Hasan Buzurg. Muhammad's father, Eretna, was an officer of Uyghur origin initially in the service of Chupan and his son Timurtash. He relocated to Anatolia following Timurtash's appointment as the local Ilkhanid governor and took part in his campaigns to subdue the Turkoman chiefs of the western periphery of the peninsula. This was cut short by Timurtash's downfall, after which Eretna went into hiding. Upon the dissolution of the Ilkhanate, he aligned himself with Hasan Buzurg, who eventually left Anatolia for Eretna to govern when he returned east to clash with the rival Chobanids and other Mongol lords. Eretna later sought recognition from the Mamluk Egypt to consolidate his power, although he played a delicate game of alternating his allegiance between the Mamluks and the Mongols. In 1343, he declared independence as the sultan of his domains. His reign was largely described to be prosperous with his efforts to maintain order in his realm such that he was known as Köse Peyghamber (lit. 'the beardless prophet'). Eretna died in 1352.

Rise to the throne and first reign
Muhammad was studying in Konya when his father passed away. He was liked by most Eretnid emirs, and upon his father's death, Eretna's vizier Khoja Ali Shah secretly invited Muhammad to Kayseri to become the new sultan, although Muhammad's older brother Jafar was already residing there. Jafar was imprisoned by Muhammad for some time, but he eventually escaped to Egypt. However, Muhammad's rule did not fare well as he behaved debaucherously and treated his siblings unfairly. Since he was young, authority came into the hands of his emirs. Turkoman tribes took control of the region of Canik. Although the Dulkadirids to the south expanded their borders at the expense of the Eretnids, the Dulkadirid beg Zayn al-Din Qaraja would soon seek protection in Muhammad's court fleeing from the Mamluks, who were preparing to prosecute him for the rebellion he led. On 22 September 1353, Muhammad deported Qarāja to Mamluk-controlled Aleppo in exchange for a payment of 500 thousand dinars by the Mamluks, who would later transport Qarāja to Cairo for his execution. This did not affect the fate of Muhammad, as he was deposed by his emirs in 1354, and his half-brother Jafar reigned for a year (until 1355).

Second reign and death
After losing the throne to his half-brother, Muhammad fled to Konya, which had been regained by the Karamanids, and later moved north to Sivas. The governor of Sivas, Ibn Kurd, recognized him and assisted him in the restoration of his rule. In April 1355, Muhammad faced Jafar at the Battle of Yalnızgöz. He came to terms with the vizier Ali Khoja and killed Jafar, reclaiming his rule. In 1361, as a reprisal to a raid by Tatars of the Chavdar (tribe) tribe, Ottoman ruler Murad I captured Ankara Castle from the Eretnids. Muhammad allied himself with the Dulkadirids in September 1362 in a joint campaign successfully driving the Mamluks away from Malatya. Mamluk governor of Damascus, Yalbugha, and his 24 thousand-strong force marched north and raided Eretnid and Dulkadirid lands. However, this effort failed to regain Mamluk control.

According to historian Kemal Göde, Muhammad reversed into conflict with Khoja Ali Shah, whom he killed near Zamantu on 30 May 1358. This deviates from İsmail Hakkı Uzunçarşılı's earlier work which explains that Khoja Ali Shah led an uprising against Muhammad in 1364 and marched towards Kayseri. Muhammad was defeated and had to request assistance from the Mamluk Sultan Al-Kamil Sha'ban. Upon a decree by the Mamluk Sultan, the governor of Aleppo sent his forces to aid Muhammad, with which he subdued and executed Khoja Ali Shah in 1365.

Soon after in October 1365, other emirs who wanted to preserve their autonomy, such as Hajji Shadgeldi and Hajji Ibrahim, killed Muhammad in Kayseri before he could reinforce his authority, enthroning his son Ali. Around that time, the eastern part of the realm, including Erzincan, Erzurum, and Bayburt, had come under the rule of a local figure, Ahi Ayna. Although İsmail Hakkı Uzunçarşılı put Muhammad's age at about 25 years old when he died, this contradicts with the belief that his son Ali was 13 years old at the time of his accession to the throne.

Family
Muhammad's son Ala al-Din Ali succeeded him after his murder. According to the work of history commissioned by the Karamanids, Karamanname, Muhammad also had an older son named Eretna. He was at some point declared as the ruler but was defeated and imprisoned by the Karamanids. While he held the throne for some time, he was eventually killed by Ala al-Din of Karaman. Muhammad's son Eretna had two sons named Esenbogha and Ghazi, the first of which is reputed to have a tomb in Niğde. However, details on his life are not mentioned by any sources of that era other than Karamanname.