The Khorezmian Empire of the Anushteginids is mostly remembered as one of Genghis Khan’s foes. However, this dynasty of Turkoman stock became the regional power of its day. Emerging from the fringes of the sedentary world, its rulers would build one of the largest empires of the Turko-Persian tradition. Their story, full of battles, murders and conspiracies, is one that deserves to be told.
From slaves to shahs
Like other dynasties that emerged in the wider Middle East and Central Asia in the Middle Ages, the origins of the Anushteginids are linked to humble beginnings and military prowess. It all started when Anushtegin, a slave (mamluk) of the Oghuz tribe of Bekdili, was purchased by a Seljuk emir. Anushtegin fought alongside his master in the name of the Seljuks. His success in the battlefield eventually landed him an important appointment in the court of Malik Shah I (r. 1072-1092): that of custodian of the sultan’s washing and bath accessories.
Becoming one of the Malik Shah’s confidants, it was not long until he was granted the military governorship of the region of Khorezm in around 1077. Located south of the Aral Sea, in what is now Uzbekistan and Turkmenistan, Khorezm was a fertile land at the northern edge of the Seljuk Empire. Despite the importance of his position, Anushtegin was overshadowed there by the governor, a mamluk of one of Malik Shah’s sons.

Shortly after Anushtegin’s death in 1097, his son Muhammad I (Qutb ad-Din Muhammad) took over and was named governor of Khorezm. Muhammad I adopted the title of Khorezmshah, as other rulers of the region had done before him. It is with him that we can consider the Anushteginid dynasty to formally commence.
Muhammad I was a talented administrator and patron of scholars. He himself had received a good education in Merv, the capital of Khorasan. The new Khorezmshah served the Seljuk sultan Sanjar with loyalty, aligning with him in the civil wars that followed. It is worth remembering that Khorezm was part of Sanjar’s domains as ruler of the Seljuk Empire and the Khorezmians were one of his vassals. After more than three decades of faithful service to the sultan, Muhammad I died in 1127. Sanjar had no doubts who should replace him: Muhammad’s own son Atsiz (r.1127-1156).
An unruly vassal
Atsiz was 29 years old when he became Khorezmshah. Like his father, he had been educated at Merv. He was a patron of religion, arts and sciences, and also wrote poetry in Persian. But Atsiz was also a warrior known for his courage in battle. His victories earned him the goodwill of his suzerain, whom he accompanied in numerous campaigns. But the Khorezmian’s duty went even further. In 1130 Sanjar embarked in a campaign in Transoxiana (Uzbekistan) to quell a revolt by another of his vassals, the Karakhanid ruler of Samarkand. Near Bukhara, the Seljuk sultan went hunting, but unbeknown to him, a number of his servants had planned to kill him. Atsiz did not go with hunting but he woke up in the middle of the night and rushed to save his sovereign’s life. Surrounded by the plotters, Sanjar was in a desperate situation, but the Anushteginid arrived just in time. How did Atsiz know about the plot? Enquired the Seljuk. “I dreamt that an accident had befallen the Sultan in the hunting grounds, and I at once hastened to his side”, he replied. However, despite this noble gesture, Atsiz’s loyalty would not last forever.
The Khorezmshah remained loyal to Sanjar during the first decade of his reign, during which he also strengthened his power at home. Then in 1138 he announced he would no longer serve the Seljuk and embarked in his own campaigns against Turkic nomads by the Syr Darya river and annexed the territory of Mangyshlak. Sanjar could not afford for one of his most important vassals to disobey him. If he did not punish Atsiz, his other vassals, the Karakhanids and Ghaznavids, could follow his example. The Seljuk marched north and defeated the Khorezmshah in the battle of Hazarasp (Uzbekistan), where Atsiz’s own son, Atlyk, perished. After seizing Khorezm, with Atsiz on the run, Sanjar granted the region to one of his nephews. However, once the sultan was back in Merv, Atsiz returned and ousted the new governor. He then asked the Seljuk for forgiveness. Sanjar accepted.
After reconciling himself with the sultan, Atsiz regrouped his troops and continued with his raids in neighbouring lands. In 1139, the Khorezmshah went as far as capturing Bukhara and killing Sanjar’s governor in the city. This was Atsiz’s revenge for the death of his own son in battle the year before. The Seljuk accepted the quid pro quo. Also, his attention was also probably elsewhere: in the East, a sinicized group of Mongol stock known as the Kara-Khitai advanced towards his possessions in Transoxiana. This did not prevent Atsiz from reaching out to the Caliph in Baghdad in a move to undermine Sanjar.
A turning point for the Seljuk Empire and the nascent Khorezmian Empire took place in 1141 north of Samarkand. There, in a place named Qatwan, the Kara-Khitai crushed the Sanjar’s troops in a battle that signified the start of the end of Seljuk dominance. Atsiz, far-sighted as well as opportunistic, took advantage of the situation. He raided Khorasan, sacked Sanjar’s capital of Merv and took the sultan’s treasure with him back to Khorezm. While in Merv, the Khorezmian even sat in the Seljuk’s throne.
Atsiz, knowing which way the wind was blowing, reached an agreement with the Kara-Khitai’s and started paying tribute to them. Sanjar, however, had other plans. In 1143-44 he rode out again to punish his unruly vassal. Without much opposition, he laid siege to the Khorezmian capital of Gurganj (Konye Urgench, in modern Turkmenistan). Atsiz begged the sultan’s pardon and the Seljuk accepted. His treasure was returned to him. Nevertheless, the Khorezmian would not give up easily and sometime later he sent two Ismaili assassins to kill Sanjar. They were discovered and executed.
Once again Atsiz decided to expand his power. This time conquering the important town of Jand (Kazakhstan). Once again Sanjar marched north to punish his vassal and sieged Gurganj in 1148. And again, surprising as it may seem, he forgave Atsiz. It would be the third and last time. Sanjar had to come to terms with the reality that a new kingdom had emerged to the north, one that was also tributary of the Kara-Khitai.
After Sanjar’s defeat and imprisonment by the Oghuz Turkoman, Atsiz tried to rally an anti-Oghuz coalition but his death at the age of 61 on July 1156 put an end to it. His former master Sanjar passed away a year later.
The establishment of the Khorezmian Empire
Atsiz was succeeded by his son Il-Arslan (1156-1172) after he carried out the usual purge: jailed and blinded his younger brother, executed the latter’s atabek, his own uncle and a number of nobles who had tried to put his sibling on the throne. Once that was done, he could focus on governing. Following the death of Sanjar, the Khorezmians stopped paying tribute to the Seljuks. They were now equals. However, they were still tributary to the Kara-Khitai.

The reign of Il-Arslan saw a territorial expansion under Khorezmian rule. First, he recovered Jand and Mangyshlak in north. Later, in the 1160s, taking advantage of the collapse of Seljuk rule in Khorasan, he seized through several campaigns important towns like Dehistan (Turkmenistan) and Nishapur (Iran). He then started interfering with the internal affairs of the Seljuks that remained in Persian Iraq. His armies ventured deep into enemy territory, sacking western towns like Qazvin.
In the east things were more complicated. In 1158, the Karakhanid ruler of Samarkand persecuted and defeated the Karluks, a nomadic Turkic tribal confederacy who had murdered his predecessor. The Karluk leader sought refuge in Khorezm and asked Il-Arslan for help. This was the opportunity the Khorezmshah was waiting for to intervene in Transoxiana. In July 1158, Il-Arslan led a large army across the Amu Darya (Oxus). What happened next is unclear. The Kara-Khitai sent an army to confront the Khorezmshah. According to Buniyatov, a battled ensued on the banks of the Zaravshan river and the Khorezmians were victorious. Other authors do not mention the existence of the battle. Whether the Kara-Khitan commander wanted to avoid suffering a complete defeat or was hesitant about fighting at all, a truce was agreed between the parties. Il-Arslan expanded his influence in Transoxiana, Bukhara and Samarkand included.

The Kara-Khitai would not give up so easily. In 1171 they crossed the Amu Darya and invaded Khorezm. When news reached Il-Arslan, he ordered to open the dykes and inundate the fields leading to his capital of Gurganj. The Khorezmshah retreated to Amul (modern Turkmenabat, Turkmenistan) and, ill, sent a general to fight the Kara-Khitai. The invaders crushed the Khorezmians, who reverted to the payment of tribute and vassalage. Il-Arslan died shortly after in Gurganj, where his mausoleum still stands. What followed was a long fraternal struggle for the throne.
A Khorezmian Game of Thrones
Prior to his death, Il-Arslan had named his youngest son, Sultan Shah, as his heir. However, it was Sultan Shah’s mother, Terken Khatun, who was the real power behind the throne. The oldest son, Tekish, appealed to the Kara-Khitai for help in his struggle against his brother. The Kara-Khitan ruler accepted and Tekish approached Gurganj with a Kara-Khitan army. Knowing they would not be able to defeat the older brother, mother and son fled south to Khorasan. Tekish crowned himself Khorezmshah, but that was just the beginning.
While in Khorasan, Terken Khatun and Sultan Shah enlisted the support of a local potentate, who marched north with an army towards Khorezm. In a battle not far from Gurganj, and thanks to a betrayal, Tekish’s army soundly defeated the enemy. Terken Khatun and Sultan Shah fled the battlefield. Some time later Terken Khatun, who was also Tekish’s mother, was captured and executed. Sultan Shah in the meantime found refuge with the Ghurids, an upcoming power that was based in what is now Afghanistan.
Tekish then decided to shake off the yoke of the Kara-Khitai. Accusing the Kara-Khitan envoys of bad behaviour, he had them executed. The same thing would be done by his son with the Mongols decades later, although the consequences would be very different. The Kara-Khitai sent an army to subdue their unruly Khorezmian vassal. Riding with them was Tekish’s brother. However, the Khorezmshah, like his father before him, flooded the plains around his capital. The Kara-Khitai realised it would be difficult to attack Gurganj and withdrew, leaving with Sultan Shah some troops. The brother of the Khorezmshah then marched to Khorasan and, thanks to his Kara-Khitan soldiers, manage to carve out his own Khorasanian principality centred in Merv. This would be a thorn on his brother’s side for years to come, until Sultan Shah’s death in 1193.
With the regions of Khorezm, Transoxiana and Khorasan under his rule, Tekish’s next objective laid in Persian Iraq. There the Seljuk dynasty was resurging under the leadership of Tughril III. The Khorezmian marched west and in 1194 defeated the Seljuk at the battle of Ray (northern Iran), where Tugrhil met his end. The Anushteginids, who started serving the Seljuks and were their vassals for decades, were the ones destined to finish off the dynasty. After Tughril’s death, Persian Iraq was there for the taking. This included campaigning against the Ismailis of Alamut, who in response had Tekish’s vizier murdered.
The Khorezmshah died a few years later, in 1200. After enduring two decades of civil war, he had expanded the borders of the Khorezmian Empire significantly. From an administrative perspective, he centralised the state, with an apparatus that was notorious for its severe discipline and order. But above all, Tekish had been a warrior that had led his troops in battle. As he used to say: “If a sovereign does not command his army personally, he is unfit to manage a country, for he is bearing the resemblance of a woman!”
However, Tekish’s wife also had a strong character. Named Terken Khatun, as the Khorezmshah’s own mother, she was the daughter of a Kipchak khan that would play a pivotal role in the empire’s history. A powerful woman, she was not wiling to put up with her husband’s behaviour, as the following episode reveals: Tekish liked to spent time in the bathhouse with female slaves, something which enraged Terken Khatun. On one occasion, she locked the hamam’s door, leaving the Khorezmshah to suffocate inside. He would have perished if it was not for the timely intervention of a slave, who manage to unlock it.
The Second Alexander the Great
Tekish had named his son Muhammad II (Qutb ad-Din Muhmmad) as successor, and he did not have to face the fratricidal wars his father did. However, things were not easy at first as he had to face a serious challenge in the shape of the Ghurids.
The Ghurids were a dynasty of Iranian stock that by that time occupied a vast territory that extended through what is now Afghanistan, Pakistan and India. After Muhammahd II’s rise to power, the Ghurids invaded and conquered Khorasan. Once he had established his power in Khorezm, Muhammad II marched south to recover the lost territory. The campaigns against the Ghurids would occupy most of the Khorezmshah’s early reign and would almost cost him his throne.
In 1204, the Ghurid sultan Shihab ad-Din (also known as Muhammad of Ghor) decided to march on Gurganj. As his father and grandfather before him, Muhammad II flooded the plains around his capital. A month later, when the land had dried, a battle followed and the Khorezmians were defeated and withdrew behind the walls of Gurganj. The Ghurids laid siege to the capital. The situation was critical. The Khorezmshah sent messengers to all parts of his empire requesting reinforcements. But it was his mother, Terken Khatun, who played a pivotal role by organising the capital’s defence and arming its inhabitants. The Kara-Khitai, to whom the Khorezmshah had desperately asked for helped, then entered the scene. Shihab ad-Din had to withdraw and was finally defeated by the Kara-Khitai in the battle of Andhkoy (northwest Afghanistan), by the Amu Darya. The Ghurid threat disappeared in 1206 with the death of Shihab ad-Din. From that time on, it was the Ghurids who would become vassals of the Khorezmian until 1215, when they were finished off by Muhammad II.
The Kara-Khitai would be next. In 1207 Muhammad II led an expedition to Transoxiana, taking Bukhara but suffering a defeat at the hands of the Kara-Khitai. The Khorezmshah went missing after the battle. Did he fall fighting with his men? Nobody knew. In fact, unbeknown to his capturers, he had been taken prisoner. He fooled the Kara-Khitai who had captured by pretending to be a servant. He escaped a year later when his fake lord, who was in the plot, sent him as a messenger to pay his ransom. Or so the historian Ibn a-Athir tells us.
In 1210, Muhammad was back in action against the Kara-Khitai and went a step further, crossing the Syr Darya (Jaxartes) and defeating the Kara-Khitai in battle. The Khorezmian rule then reached as far as Uzgen (Kyrgyzstan). The internal instability of the Kara-Khitai later that decade, that ended with the Mongol invasion in 1218, allowed the Khorezmshah to extend his grip in the region. Shash (Tashkent) was one of the victims of Muhammad II, who order its destruction. Samarkand fared significantly better under the Khorezmshah and in 1212 displaced Gurganj as the capital.
In the west things did not go as planned. Muhammad II wanted the Caliph to recognise him as Sultan of Islam, but Al-Nasir, based in Baghdad, declined. He had reached out to the Ghurids in the past looking for them to attack the Khorezmshah. Rummaging through the Ghurid archives in Ghazni, the Khorezmians found the letters. Enraged, Muhammad assembled a large force and marched towards Baghdad. However, his troops were decimated by the cold and snow crossing the Asadabad pass (western Iran). The conquest of Baghdad would have to wait. His attention was needed in the east.
At this stage, the Khorezmian Empire was at its peak. Muhammad II had built on the state inherited from his father. In less than two decades, he had expanded Khorezmian rule in Transoxiana, the steppe and Khorasan, shaken off the Kara-Khitan yoke and eliminated the Ghurid threat. The Khorezmshah’s domain stretched from the western shores of the Caspian to the Ferghana valley, from the Aral Sea to the Persian Gulf. No wonder he decided to give himself the title of Iskandar-i Thani (Second Alexander the Great) and later, because apparently that was not enough, of Sultan Sanjar (in reference to the Seljuk ruler). But cracks had already started to appear.

Muhammad II, despite his military successes and titles, was not the undisputed ruler of his empire. His mother, the Kipchak Terken Khatun, wielded considerable power, to the extent that in many instances the mother invalidated her son’s decrees and orders. She had the military on her side, given that many of the commanders were from her own tribe. When Muhammad decided to establish himself in Samarkand, his mother remained in Gurganj, where she had her own court and dispatched with senior ministers and dignitaries. As the Khorezmian Empire grew, so did her possessions. At Terken Khatun’s insistence, the Khorezmshah named his son Ozlagh Shah as heir, in detriment of the older Jalal ad-Din, and gave him Khorezm, Khorasan and Mazandaran. This apparent diarchy would undermine the state at a time when it would face its toughest test yet, for in the east a storm was brewing… To find what that was, go to The Khorezmian Empire: collapse and resistance (part II)
Further readings
Buniyatov, Z.M. (2015). A History of the Khorezmian State under the Anushteginids, 1097-1231. Samarkand: International Institute for Central Asian Studies (IICAS)
Grousset, René (1970). Empire of the Steppes. New Brunswick: Rutgers University Press.
[…] This is a continuation of “The Khorezmian Empire: from slaves to Khorezmshahs (part I)” […]
[…] thrived under the Khwarezmian dynasty, the ephemeral empire that stretched from the Caucasus to the steppes of Central Asia before it was […]