The Karakhanids were then vassal of the Seljuks, and Mahmud appealed to the Seljuk sultan Ahmad Sanjar for help.
Entón os karakhánidas eran vasalos dos selxúcidas, e Mahmud apelou a axuda do sultán selxúcida Ahmad Sanjar.