Pir Ahmet as well as his brother Kasım escaped to Uzun Hasan's territory. This gave Uzun Hasan a chance to interfere. In 1472, the Akkoyunlu army invaded and raided most of Anatolia (this was the reason behind the Battle of Otlukbeli in 1473). But then Mehmed led a successful campaign against Uzun Hasan in 1473 that resulted in the decisive victory of the Ottoman Empire in the Battle of Otlukbeli. Before that, Pir Ahmet with Akkoyunlu help had captured Karaman. However Pir Ahmet couldn't enjoy another term. Because immediately after the capture of Karaman, the 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 had been transferred to İstanbul by Gedik Ahmet Pasha, so he finally gave up. Demoralized, he escaped to Akkoyunlu territory where he was given a "tımar" (fief) in Bayburt. He died in 1474.