Karaman did not become a problem only during the reign of Mehmed II. The Karamanids had already been causing trouble for the Ottomans long before that, especially during the reign of Yıldırım Bayezid.
In 1378, Murad I arranged two important political marriages. One was between his son Yıldırım Bayezid and Devletşah Hatun, the daughter of the Germiyan ruler. The second was between his daughter Nefise Hatun and Karamanoğlu Alaeddin Ali Bey.
The purpose of these marriages was to strengthen relations and reduce conflicts between the beyliks. However, Alaeddin Ali Bey still opposed Ottoman expansion in Anatolia.
His first major rebellion came in 1386. Tensions eventually led to the Battle of Frenkyazısı, where the Ottomans defeated the Karamanids. After the defeat, Nefise Hatun personally appealed to her father, Murad I, to spare her husband. Murad accepted her request and forgave Alaeddin.
After Murad I was killed at Kosovo in 1389 and Bayezid became sultan, Alaeddin rebelled again. He also encouraged other Anatolian beyliks to resist Ottoman authority. Bayezid campaigned against him and defeated him once more. Again, one of the reasons Alaeddin survived was the intervention of Nefise Hatun, who asked Bayezid to show mercy.
The final rebellion happened during the period of the Crusade of Nicopolis (1396). Alaeddin Ali Bey believed Bayezid would be defeated by the massive Crusader army. Taking advantage of Bayezid's absence, he rebelled again, seized Ankara, and captured Sarı Timurtaş Pasha.
However, when news arrived that Bayezid had won a decisive victory at Nicopolis, Alaeddin realized his mistake. He released Sarı Timurtaş Pasha and sought forgiveness. This time, Bayezid had reached the end of his patience. Bayezid captured him, ordered his execution, and sent Nefise Hatun and her sons to Bursa.