Mongol invasion of Persia and Mesopotamia

The Mongol conquest of Persia comprised three Mongol campaigns against Islamic states in the Middle East and Central Asia between 1219 and 1258. These campaigns led to the termination of the Khwarazmian dynasty, the Nizari Ismaili state, and the Abbasid Caliphate of Baghdad, and the establishment of the Mongol Ilkhanate government in their place in Persia.

Genghis Khan had unified the Mongolic peoples and conquered the Western Xia dynasty in the late 12th and early 13th centuries. After a series of diplomatic provocations on the part of Muhammad II, the ruler of the neighbouring Khwarazmian Empire, the Mongols launched an invasion in 1219. The invaders laid waste to the Transoxianan cities of Bukhara, Samarkand, and Gurganj in turn, before obliterating the region of Khorasan, slaughtering the inhabitants of Herat, Nishapur, and Merv, three of the largest cities in the world. Muhammad died destitute on an island in the Caspian Sea. His son and successor, Jalal al-Din, tried to resist the Mongols, but was eventually defeated and forced into exile. Genghis returned to his campaign against the Jin dynasty in 1223, only retaining governance of the northern Khwarazmian regions.

The war had been one of the bloodiest in human history, with total casualties estimated to be between two and fifteen million people. The next three decades saw conflicts of lesser scale but equal destruction in the region. Soon after his accession to the khaganate in 1227, Ögedei Khan sent an army under Chormaqan Noyan to end Jalal al-Din's resistance and subjugate several minor polities in Persia. This was carried out gradually: al-Din was killed in 1231, with Isfahan and Maragheh being besieged and captured the same year; Irbil was captured in 1234; and Georgia was gradually subjugated and vassalised before Chormaqan's death in 1241. Several other Persian towns and cities, such as Hamadan, Ray, and Ardabil, were also captured by the Mongols.

The final stage began in 1254. On the orders of his brother, the Khagan Möngke Khan, Hulagu Khan systematically captured the fortresses of the Nizari Ismaili state in northern Persia, seizing their capital of Alamut in 1256. In 1258, Hulagu then marched on the Abbasid Caliphate of Baghdad; capturing the city, he ended the 500-year-old Abbasid dynasty by killing the caliph Al-Musta'sim, marking the end of the Islamic Golden Age. Persia would later become the heartland of the Mongol Ilkhanate.

Expansion of Sultan Muhammad's territory and war with Abbasid Caliph Al-Nasir
After the fall of the Seljuks of Persian Iraq, with the defeat of Toghrul III by Ala al-Din Tekish, the father of Sultan Muhammad, a severe enmity arose over the governance of Western Iran between Abbasid Caliph Al-Nasir and Ala al-Din Tekish. These conflicts continued during the reign of Sultan Muhammad. Therefore, during the reign of Sultan Muhammad, Western Iran became the Battleground of the Khwarazmi troops and the Caliphate troops. In order to destroy Khwarazmian Empire, Al-Nasir not only provoked Ghurid sultans and fanatical religious scholars from Transoxiana against him, but also asked help Nizari Ismaili state, Qara Khitai Empire and Mongol tribes to fight against Khwarazmian Empire. This action not only led to the overthrow of Khwarazmian Empire, but also the overthrow of the Abbasid government.

Simultaneously with the coronation of Sultan Mohammad, the Ghurids captured the remaining lands of Ghaznavid empire and Khorasan cities such as Balkh city after the Overthrow of the Ghaznavids. Sultan Muhammad defeated the Ghurid dynasty in 1212 and captured Ghaznin in 1215, thus he extended the border of his territory to India from the east. In 1209, he conquered Mazandaran, which had been held by the Bavands for a long time. In the 12th century, a group of Khitan people from North China, who were Buddhists, had formed a large government in the province of Kashgar and Hotan called Qara Khitai. In order to block their way, the Khwarazmians had agreed to pay them a yearly tribute. This custom continued until the time of Sultan Muhammad, but he refused to pay tribute to the "polytheist" king. Sultan Muhammad fought three times with the Qara Khitais. At last In 1210, the Sultan asked help from Kuchlug Khan, a prince of the Naimans and the leader of them, to defeat Qara Khitais. Kuchlug defeated them in Transoxiana and conquer Bukhara and Samarkand, he also managed to usurp the empire from his father-in-law Yelü Zhilugu.

After conquesting Transoxiana, Kuchlug alienated both his subjects and the Khwarazmian empire with anti-Muslim measures. As a Mongol detachment led by Jebe hunted Kuchlug down, he fled; meanwhile, Muhammad was able to vassalize the territories of Balochistan and Makran in modern-day Pakistan and Iran, and to gain the allegiance of the Eldiguzids.

After extending the borders of Khwarazmian Empire from the north-east and east to Kashgar and the Sindh, Sultan Muhammad decided to conquer the west, i.e. Iraq. At that time, these countries were in the hands of Eldiguzids and Salghurids, and the authority of the Abbasid caliph's clergymen remained in these two regions partly. Sultan Muhammad was at enmity with the Caliph, because the caliph asked for help from the Ismailis and Qara Khitais to overthrow his rule and also because the Sultan wanted the authority of the Khwarazmians sentence in Baghdad. As a result of this dispute and enmity, Sultan Muhammad received a fatwa from the scholars of her country that "Bani Abbas" do not deserve the caliphate and one of "Husayni Sadat" (a person from the generation of Imam Husayn) should be chosen for this position. Therefore, he declared the caliph deposed and ordered that the name of the Abbasid caliph should not be mentioned in sermons and not be inserted on coins, and appointed one of the Termezi Alawi Sadats, as the caliphate. In 1217, Sultan Muhammad marched towards Baghdad, but because it was winter, his troops suffered a lot from the snow and cold in the Asadabad pass Between Kermanshah and Hamadan, and he returned to Khorasan.

The incident of killing the Mongol merchants in Otrar
Genghis conquered Beijing after raiding northern China. Then he forced the Uyghur clans to obey him, Kuchlug Khan, the leader of the Naiman tribes, who had dominated the lands of the Qara Khitai tribes, was driven from there, and thus Genghis found a common border with Khwarazmian, whose eastern border had reached these areas. What emerges from the evidence is that Genghis' campaign to Iran was not to gain a new land and gain trophies, because of the rich and huge country of China that he had under his control, so he didn't need to campaign to Iran because. Genghis was very interested in the spread of commerce and the movement of merchants, therefore he encouraged commerce and tried to establish friendly relations with Sultan Muhammad, whom he considered as a powerful king. So, he sent a group of his merchants headed by Mahmud Yalavach with gifts to visit Sultan Muhammad and informed him about the size of his country, prosperity of his possessions, and the strength of his army. Sultan Muhammad, who was trying to expand Khwarazmian's territory, got angry that Genghis had called him "his son" in his letter, but Mahmud Yalavach quelled his anger and made him agree to establish friendly relations with Genghis Khan.

In this way, the first ambassador of the Sultan Muhammad was accepted in Beijing, and Genghis declared trade between the Mongols and Khwarazmians as a necessity for establishing friendly relations. During this situation, a number of Muslim merchants from Sultan Muhammad's territory took some goods to the Mongol Empire, and although Genghis treated them violently at the beginning of their arrival, he finally appeased them and sent them back with respect. At the time that they were returning in 1218, a number of Mongol merchants, whose number reached 450 and apparently most of them were Muslims, was sent by Genghis with some goods and a letter containing his advice and request to establish relations between the two governments. But Inalchuq, the ruler of Otrar who was the nephew of the Terken Khatun (Sultan Muhammad's mother) and supported by her, was greedy for the wealth of the merchants and arrested the Mongol merchants on the charge of espionage on the border of the territory under his rule, and then with the permission of Sultan Muhammad, who was in Persian Iraq at that time, massacred all these merchants. Then the officials of Khwarazmian sold the cargo of the caravan, which included 500 camels of gold, silver, Chinese silk artefacts, precious skins and such on, and sent the resulting amount to the capital of Khwarazmian government.

When the news of Otrar incident reached Genghis Khan, Genghis Khan decided to control his anger and made his last attempt to gain satisfaction through diplomacy. He sent a Muslim, who was previously in the service of Sultan Tekish and was accompanied by two Mongols, to protest against the performance of Inalchuq and requested to surrender him the Mongols. Sultan Muhammad didn't want to surrender Inalchuq because most of the leaders of Khwarazmian army were his relatives, and also Terken Khatun who had influence in the Khwarazmian court was supporting him. Therefore, Sultan Muhammad not only didn't accept Genghis Khan's request, but also killed his Muslim envoy who came to Samarkand, the capital of Khwarezmian, and sent his companions back to Genghis with their beards and mustaches cut off. This bellicose behavior of Sultan accelerated Mongol invasion of Central Asia. Historians cite the fact that Genghis was already bogged down in his war against the Jin in China, and that he had to deal with the Hoi-yin Irgen rebellion in Siberia in 1216. So he didn't want to start another war.

Economic factors
The Mongols had a need for the goods of more advanced regions; therefore, it was very important for them to keep trade routes open since ancient times. From the beginning of his monarchy, Genghis Khan attached great importance to commerce because he needed to procure weapons from India and Damascus; he also needed markets to sell Mongolian and Chinese products. But the conflict between Sultan Muhammad and Kuchlug Khan, the leader of the Naimans, had caused the closure of the roads and the interruption between the east and west trade. At the same time as this interruption in the land routes, the sea route of the Persian Gulf was also blocked due to the war between the ruler of Kish and the ruler of Hormuz, which resulted in a trade crisis in the Central Asian region. The merchants wanted the end of the conflicts and the opening of the roads. Hence, In the Mongols' attacks, some Muslim merchants helped Genghis to progress to the west. To solve this crisis, Kuchlug Khan was killed by the Mongols in 1218. Sultan Muhammad didn't care to the importance of trade relations with the Far East and the location of his land on the Silk Road, and he was indifferent to the merchants' needs and the Genghis' wishes, so after removing Kuchlug Khan, it was Sultan Muhammad's turn.

Genghis' army raid
ِDespite Muhammad II's apparent authority, he was unprepared to defend his polity in case of the Mongol attack. During preparations for the war, he collected taxes from his people three times in one year, causing dissatisfaction and unrest among the population. Before the invasion, Sultan Muhammad formed a council composed of his army commanders. Imam Shahab al-Din Khiyoqi, one of the famous jurists and teachers of Khwarazm, proposed to bring as many soldiers as possible from different corners of the empire and prevent Mongols from crossing Seyhan, but the commanders of the Khwarazmian army did not fancy his plan. They suggested that they wait for the Mongols to arrive to Transoxiana and reach the difficult straits. They also proposed to attack the Mongols when they would be having certain difficulties considering their supposed lack of knowledge of the loсal terrain. The Sultan didn't give importance to the counsel of Shahab al-Din, and accepted the plan of the latter before scattering his troops to protect major cities of the empire. Sultan Muhammad, meanwhile, left for Balkh.

The conquest of Transoxiana
In September 1219, Genghis Khan arrived at Utrar, on the border of the Khwarezmshah territory, and divided his forces into three part; He assigned one part to his sons Ögedei and Chagatai to besiege Otrar, sent another part under the command of Jochi to take the cities around Seyhan River towards the city of Jand, and he himself moved towards Bukhara with his son Tolui at the head of the main forces. Genghis always used the services of advisers, roadmen and merchants during his campaigns. Therefore, there was always a group of Muslim merchants, who were familiar with roads of Khwarzamia, were in his camp for their advice. Also, after the start of the invasion, some of the commanders of Kwarazmia who were hostile to him like Badr al-Din Omid, whose father and uncle were killed by the order of Sultan Muhammad, also joined Mongol army and gave a lot of information to Genghis about the situation in the Sultan's court and the roads. From the method of attack, the division of the army and other decisions of Genghis, it can be said that Genghis was familiar with the geographical situation of Transoxania really well.

The conquest of Bukhara, Samarkand and Otrar
In 1220, Genghis Khan attacked Bukhara with the main forces of his army. The Sultan was caught completely unaware. He had anticipated that Genghis would attack Samarkand first, where both his field army and the garrison stationed at Bukhara would relieve the siege. The Khan's march through the Kyzylkum had left his field army impotent, unable to either engage the enemy or help his people. The Khan faced strong resistance from the defenders of the city; But this resistance did not last long. The city fell in less than two weeks, because the city's communication routes was cut off from all sides, they gave up their resistance Inevitably. After capturing Bukhara, the Mongol invaders killed thousands of unarmed and defenseless citizens and took the rest as slaves. Genghis summoned the elders of Bukhara and told them that the purpose of summoning them is collecting the assets that Sultan Muhammad sold to merchants (The Otrar incident), because these objects belong to Mongols. They brought all the property they had from Otrar caravan and handed them over to the Genghis Khan. Then they took the road to Samarkand.

Sultan Mohammad greatly emphasized the defense of Samarkand and had gathered a large force in this city and the fortifications of the city had been repaired. According to various historians, between 50,000 and 110,000 soldiers had gathered in Samarkand to defend the city. It seems that the city could have resisted the siege for several years. On the third day of the siege, a group from defenders of the city came out of their positions and attacked the enemy. They killed some of the Mongol soldiers, but then they were surrounded by the enemy, and most of them perished on the battlefield. This unsuccessful attack had an unfortunate effect on the morale of the defenders. Some influential people of the city decided to surrender and sent the judge and Shaykh al-Islām of the city to Genghis Khan to talk about surrender. Finally, they opened the gate of the city to the enemy, and Genghis' army entered the city and massacred and looted the people. After the attack, the city of Samarkand became a ruin and was deserted. Mongol soldiers took the city of Otrar after a decisive attack, but the fortress of Atarar resisted for a month (according to some documents, six months). After taking the fortress of Otrar, Mongols killed all the defenders of the city and the castle.