Alp Arslan, father of Malik-Shah gave his own daughter Princess Aisha Khatun to Sham al-Mulk Nasr, the son and successor of the Qara Khanid Tamghach Khan Ibrahim, Terkhan Khatun's father. Later in 1065 he married his son to Terken Khatun, who was aged twelve at the time and Malik-Shah was about the same age. Nizam al-Mulk's position vis-à-vis the sultan was thus to some extant unsatisfactory, and his influence at the subordinate households of the sultan's wives and those of the princes was still weaker.