The Invasion of the Khwarazmid Empire
To the west of the Mongol heartland lay the Khwarezmid Empire, an Islamic Empire ruled by Shah Ala ad-Din Muhammad. The Sultan was well aware of the recent increase in Mongol wealth and stature, but at the time he was more concerned with his ongoing political contest with the Caliph in Baghdad who held claim to the allegiance of all Muslims. So when the Mongols, flush with the riches of China, approached the Shah with a proposal to open a trade between them he agreed.
When the first Mongol caravan arrived in the city of Otrar, however, the governor there accused them of being spies and arrested them. Mongol emissaries soon appeared, demanding the release of the caravan, but the governor cut the head off of one of them in response. Unwilling to accept this affront, Genghis Khan dispatched an army of more than 100,000 men into Persia in 1219 to get his revenge upon the Khwarezmian Shah. He tasked one contingent of this army with a single mission: to hunt down and kill Shah Ala ad-Din Muhammad.
Still, the main force remained under the direct command of the Khan. It proceeded to Otra and invested the city for five months before taking the walls. The governor, who had himself precipitated the invasion when he executed a Mongol emissary, held out in the citadel for another month. When the Mongols finally broke into the fortress he retreated with his men up the citadel, floor by floor, eventually crawling out onto the roof and throwing tiles down on the invaders when all other options evaporated. He was captured all the same, and Genghis Khan had him executed.
From Otra the Mongols went on to take Bukhara and then the Khwarezmian capital at Samarkand. The Shah fled while the Mongols led the population out of the city for execution. Their heads were stacked into pyramids. Though the Shah would succumb to sickness soon thereafter, Genghis Khan pushed ahead. What followed was a campaign of annihilation in which the entire population of one city after another was put to the sword. As many as 1,200,000 may have died in Urgench, and the Mongols killed another 700,000 at Merv. At Nishapur they even killed the cats and the dogs in the streets so that nothing would be left alive.