In 1141, Sanjar with his army arrived in Samarkand. The Kara-Khitans, who were invited by the Khwarazmians (then also a vassal of the Seljuks) to conquer the lands of the Seljuks, and also responding to an appeal to intervene by the Karluks who were involved in a conflict with the Karakhanids and Seljuks, also arrived.[9]