In the early 13th century, the Khwarazmian dynasty was governed by Shah Ala ad-Din Muhammad. Genghis Khan saw the potential advantage in Khwarezmia as a commercial trading partner using the Silk Road, and he initially sent a 500-man caravan to establish official trade ties with the empire. However, Inalchuq, the governor of the Khwarezmian city of Otrar, attacked the caravan that came from Mongolia, claiming that the caravan contained spies and therefore was a conspiracy against Khwarezmia. The situation became further complicated because the governor later refused to make repayments for the looting of the caravans and handing over the perpetrators. Genghis Khan then sent again a second group of three ambassadors (two Mongols and a Muslim) to meet the Shah himself instead of the governor Inalchuq. The Shah had all the men shaved and the Muslim beheaded and sent his head back with the two remaining ambassadors. This was seen as an affront and insult to Genghis Khan. Outraged, Genghis Khan planned one of his largest invasion campaigns by organizing together around 100,000 soldiers (10 tumens), his most capable generals and some of his sons. He left a commander and number of troops in China, designated his successors to be his family members and likely appointed Ögedei to be his immediate successor and then went out to Khwarezmia.