On the eve of the Mongol invasion, Yaqut al-Hamawi's geographical survey described Bukhara as "among the greatest cities of Central Asia".[1][a] With a population of close to 300,000 and a library of 45,000 books, the city rivalled Baghdad as a centre of learning and culture.[2][3] The Poi-Kalyan mosque, which had been commissioned in 1121, was one of the largest in the world, and contained the Kalyan minaret.[4] The city was guarded by the Ark of Bukhara, a fortress established in the fifth century which served as a citadel; the farmlands were extensively irrigated using water from the River Zeravshan.[5] During the twelfth century, the city had been under the rule of the Qarakhanids, who had historically controlled many of the richest cities in the area, such as Samarkand, Tashkent and Fergana.[6] Nominally vassals of the Qara-Khitai Khanate, the Qarakhanids were allowed to operate autonomously, due to the large population and territory under their control. By 1215, they had been subjugated by the Khwarazmians, also former vassals of the Qara-Khitai, who had expanded from Gurganj into the power vacuum left by the collapsing Seljuk Empire.[7][8] In 1218, Khwarazmshah Muhammad II was Sultan of Hamadan, Iran and Khorasan, and had established dominion over the Ghurids and the Eldiguzids.[7] The Khwarazmian dynasty had usurped the QaraKhitai, already destabilized by refugees fleeing the conquests of Genghis Khan, who had begun to establish hegemony over the Mongol tribes.[9] Following the defeat of their common enemy, the Naiman prince Kuchlug, relations between the Mongols and the Khwarazmids were initially strong,[10] but the Shah soon grew apprehensive regarding the Mongols. The chronicler al-Nasawi attributes this to an unintended earlier skirmish with Mongol troops, whose speed and mobility frightened the Shah.[11] In 1218, the Shah allowed Inalchuq, the governor of Otrar, to arrest a Mongol trade caravan, and to seize its goods. Seeking a diplomatic resolution, Genghis Khan sent three envoys to Gurganj, but Muhammad humiliated them, publicly executing one. Outraged, Genghis left his ongoing war against the Chinese Jin dynasty, and rode westwards in 1219 with most of his army, leaving only a minimal force behind under the command of Muqali.[12] Prelude See also: Mongol conquest of the Khwarazmian Empire There are conflicting reports as to the size of the total Mongol invasion force. The highest figures were calculated by classical Muslim historians such as Juzjani and Rashid al-Din.[13][14] Modern scholars such as Morris Rossabi have indicated that the total Mongol invasion force cannot have been more than 200,000;[15] John Masson Smith gives an estimates of around 130,000.[16] The minimum figure of 75,000 is given by Carl Sverdrup, who hypothesizes that the tumen (the largest Mongol military unit) had often been overestimated in size.[17] The Mongol armies arrived in Khwarazmia in waves: first, a vanguard led by Genghis' eldest son Jochi and the general Jebe crossed the Tien Shan passes, and started laying waste to the towns of the eastern Fergana Valley. Jochi's brothers Chagatai and Ogedai then descended on Otrar and besieged it.[18] Genghis soon arrived with his youngest son Tolui, and split the invasion force into four divisions: while Chagatai and Ogedai were to remain besieging Otrar, Jochi was to head northwest in the direction of Gurganj. A minor detachment was also sent to take Khujand, but Genghis himself took Tolui and around half of the army — between 30,000 and 50,000 men — and headed westwards.[19] Genghis Khan between 1207 and 1225 The Khwarazmshah faced many problems. His empire was vast and newly formed, with a stilldeveloping administration.[20] His mother Terken Khatun still wielded substantial power in the realm—Peter Golden termed the relationship between the Shah and his mother "an uneasy diarchy", which often acted to Muhammad's disadvantage.[21] The Shah distrusted most of his commanders, the only exception being his eldest son and heir Jalal al-Din, whose military skill had been critical at the Irghiz River skirmish the previous year.[22] If the Khwarazmshah sought open battle, as many of his commanders wished, he would have been outmatched by the Mongol army, in both the size of the army and its skill.[23] The Shah thus decided to distribute his forces as garrison troops in the empire's most important cities.[12] Since it was far from the presumed theatre of war, Bukhara was allotted relatively few troops. As with the Mongol army, there is also debate as to the size and composition of the Shah's forces. The chronicler Juvaini states that 50,000 were sent to aid Otrar, and that there were at least 20,000 in Bukhara.[24] According to Sverdrup, there were between two and five thousand men at Bukhara.[25] Deducing the Shah's strategy, Genghis bypassed the stronghold of Samarkand and traversed 300 miles of the Kyzylkum Desert to reach Bukhara on 7 February 1220. As contemporaries thought the Kyzylkum impassable by large armies, modern historians such as H. Desmond Martin and Timothy May have considered the manouevre a tactical masterstroke.[26][27][28]