The khwarazmid empire was another Turkic empire who seized the power from the Seljuks and ruled Iran in the 11th century. The founder of the empire was Anush Tigin. The capital of the empire was Urgench and it was at the end of this dynasty that the Mongol invasion occurred.
In the beginning, Nush Tigin was one of the slaves of the Seljuk kings and later, because of his wisdom and efficiency, became the chief of Khwarazm in Khorasan.
After Nush Tigin, his son Qotb Al- Din Muhammad became the ruler of Khwarazm. His Son, Otsoz was also recognized by the Seljuk king as the ruler of Khwarazm but they were all under the control of the Seljuks and could not act independently. Later because of the quarrels for the throne of the Seljuk kingship, the Khwarazm rulers found the opportunity to expand their territory and announce themselves as “Khwaramshah “that means the king of Khwarazm. Later, under the rule of Ala Ad-din Tekesh, they took all the Seljuk lands and became the dominant dynasty in Iran, though they were all under the rule and control of the Abbasid Caliphates in Iraq.
After Ala Ad-din Tekesh, his Son Mohammad was announced as Sultan Mohammad Khwarazmshah. At this time Chengiz, the Mongol king sent a group of traders to Iran who was killed by a town chief. Chengiz wanted Sultan Mohammad to surrender the person to him to be judged and killed; but the Khwarzmi king ignored his request and it lit a sparkle for the Mongol invasion in 1231 when the Mongols destroyed the whole country and culture of Iran and ruined whatever there was of art, literature and science.