Mehmed II, after turning his attentions eastward to clean up the remnants of imperial Greek rule in 1461, had been faced with the growing power of the Ak Koyunlu, whose leader, Uzun Hasan, had continued the tradition of close relations between the imperial throne and his own kingdom.
As a consequence, he had supported the Empire of Trebizond and sent them military aid, but his support wasn't enough to save Trebizond from the Ottoman forces.
After Mehmed II conquered all of the Eastern Black Sea region, Uzun Hasan, fearing that the Ottomans would return to take his own principality, had decided to seek help from Christian powers, and had signed a treaty with the Republic of Venice, who are menaced in the Aegean Sea by the expanding Turkish presence.
Another reason for tensions between the Ak Koyunlu and the Ottomans is the political standing of the Karamanids, the most powerful Turkish beylik in Anatolia.
İbrahim Bey, the ruler of Karamanids, had supported the growing power of Uzun Hasan.
When İbrahim Bey died in 1464, his son Pir Ahmet had tried to ascend the throne, but his half brother İshak Bey, who was the legal heir, had become the bey with the support of Uzun Hasan.
Nevertheless, Pir Ahmet had not given up and had requested the support of Mehmet I, offering a part of his beylik in return With Ottoman support he had 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.
Keeping his promise to the sultan, he had ceded a part of the beylik to the Ottomans, but was uneasy about the loss of these lands, so during the Ottoman campaign to the west, he had retaken his former territory.
However, Mehmet had responded by capturing both Karaman (Larende) and Konya, two major cities of the beylik, in 1466.
Pir Ahmet, together with his brother Kasım, had made a narrow escape to Uzun Hasan's territory.
A few years later, Ottoman vizier Gedik Ahmet Pasha had captured the coastal region of the beylik.
This had given Uzun Hasan a chance to interfere.
In 1472, the Ak Koyunlu army had invaded and raided much of Anatolia.
With Akkoyunlu help, Pir Ahmet had captured Karaman, but almost immediately afterward, Mehmed II returns with his army in 1473 to defeat Uzun Hasan.
The Turkemens have a traditional army with considerable numbers of light cavalry, whereas the Ottoman army, equipped with the latest technology, arrives with matchlock arms and cannons.
The Ottomans gain a decisive victory over the Turkmens, whose army is nearly destroyed in eight hours of fighting.
Uzun Hasan, after receiving the decapitated head of one of his sons, flees the battlefield.
The forced withdrawal of the decimated Ak Koyunlu army leaves Mehmed in control of all Anatolia, and Venice without a powerful ally.
It also brings the Ottomans into conflict with the Mamluk empire of Syria and Egypt, which seeks to expand into southeastern Anatolia.
Pir Ahmet attempts to continue his struggle, but when he learns that his family members have been transferred to Constantinople by Gedik Ahmet Pasha, he finally gives up the fight.
Demoralized, he escapes to Akkoyunlu territory, where he is given a tımar (fief) in Bayburt.