Mu'ayyid al-Din Ai-Aba (died July 1174) was the amir of Nishapur from c. 1154 until his death. Although nominally subservient to the Seljuks of Khurasan, he acted as an independent ruler. Due to his control of much of Khurasan, the historian Ibn Funduq called him "Emperor of Khurasan, King of the East."
Ai-Aba had once been a ghulam of the Seljuk Sultan Sanjar, who ruled in Merv. After Sanjar was captured by a band of Ghuzz nomads in 1153 his empire quickly fell into chaos as Ghuzz tribes overran much of the sedentary areas. Sanjar's amirs attempted to restore order by recognizing Suleiman Shah as sultan. Suleiman Shah quickly demonstrated that he was incapable of dealing with the Ghuzz and fled; the amirs then set up the Karakhanid Mahmud Khan in his place, but he did little better.
With the central government unable to restore order on its own, Ai-Aba was free to pursue a largely independent policy in Khurasan. He first drove the Ghuzz out of Nishapur, Tus, Damghan, and several other cities. By lowering taxes and placating the landowners, he was able to build up a good reputation and expand his influence over much of Khurasan. After Mahmud Khan was appointed as sultan, Ai-Aba initially resisted submitting to him; after prolonged negotiations he was convinced to become Mahmud's vassal, although he retained his autonomous rule of the cities he administered.
Sanjar had escaped from Ghuzz captivity in 1156, but died a year later; before his death he confirmed Mahmud Khan as his successor. In spite of this, Mahmud Khan was incapable of establishing any effective control over Ai-Aba and was forced to deal with him as an equal. The latter had gone to war after Sanjar's death against Ikhtiyar al-Din Ai-Taq, another amir who had formerly been one of Sanjar's ghulams. Ai-Taq received assistance from the Bavandids of Tabaristan, but was nevertheless defeated by the armies of Ai-Aba and Mahmud Khan and was compelled to make peace with them in 1158.