Karamanid was a Turkmen state in central Anatolia after the disintegration of Seljuq Sultanate of Rûm.
In 1398, Bayezid I of the Ottoman Empire conquered the Karamanid state and jailed Mehmed and Ali.
In 1420 Mehmed tried to capture the city of Kayseri from the Dulkadirids, which was a vassal of Mamluk Sultanate.
Mamluks arrested Mehmed and supported Ali to gain the possessions of his brother.
However İbrahim chose to make peace with his uncle by giving him extra possession as iqta in addition to Niğde.