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 İstanbul 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.