Pir Ahmed

Pir Ahmed of Karaman was a bey of Karaman Beylik, a Sunni Muslim Turkoman principality in Anatolia in the 15th century. He was son of Ibrahim II of Karaman and Ilaldi Sultan Hatun, daughter of Ottoman Sultan Mehmed I, and had a daughter, Hilmiye Hatun.

Struggle for the throne
When his father İbrahim Bey died in 1464, he tried to ascend to throne. But his half brother İshak Bey who was the legal heir, struggled for the throne and became the bey with the support of Uzun Hasan, the sultan of Akkoyunlu (White Sheep) Turkomans. Nevertheless, Pir Ahmet didn't give up. He asked Ottoman sultan Mehmet II for support and offered a part of his beylik in return to support. With Ottoman support he defeated his brother in the battle of Dağpazarı. İshak escaped to Silifke, the southern frontier of the beylik and Pir Ahmet assumed the title bey.

As a bey
He kept his promise and ceded a part of the beylik to Ottomans. But he was uneasy about the loss. So during the Ottoman campaign to west, he captured his former territory. However, Mehmet returned and captured both Karaman (Larende) and Konya two major cities of the beylik in 1468. Pir Ahmet barely escaped to east. A few years later, Ottoman vizier (later grand vizier) Gedik Ahmet Pasha captured the coastal region of the beylik.

Further struggles and death
Pir Ahmat as well as his brother Kasım escaped to Uzun Hasan's territory. This gave Uzun Hasan a chance to interfere. In 1472, Akkoyunlu army invaded and raided most of Anatolia. (This was the reason behind the Battle of Otlukbeli in 1473) With Akkoyunlu support, Pir Ahmet captured Karaman. However Pir Ahmet couldn't enjoy another term. Because immediately after the capture of Karaman, Akkoyunlu army was defeated by the Ottomans near Beyşehir and Pir Ahmet had to escape once more. Although he tried to continue his  struggle,  he learned that his family members were transferred to Istanbul by Gedik Ahmet Pasha and he finally gave up. Demoralized, he escaped to Akkoyunlu territory where he was given a tımar (fief) in Bayburt, He died in 1474.