The Naimans were located to the west of the Mongols, and there were more Naimans than Mongols in the late 12th century. In 1199, Temüjin (Genghis Khan) together with an ally Ong khan launched a campaign against the Naimans. They defeat Buyirugh, a Naiman khan who ruled the mountain lineage. In 1203, the last Tayang khan, the ruler of Naimans of the steppe, was killed after a battle with Genghis Khan. His son Kuchlug with his remaining Naiman troops then fled to the Kara-Khitan Khanate. Kuchlug was well received there and the Khitan Khan gave him his daughter in marriage. Kuchlug soon began plotting against his new father-in-law, and after he usurped the throne, he began to persecute Muslims in the Hami Oases. But his action was opposed by local people and he was later defeated by the Mongols under Jebe.