The Mongol conquest of China was a series of major military efforts by the Mongol Empire to invade China proper. It spanned six decades in the 13th century and involved the defeat of the Jin dynasty, Western Xia, the Dali Kingdom and the Southern Song. The Mongol Empire under Genghis Khan started the conquest with small-scale raids into Western Xia in 1205 and 1207. By 1279, the Mongol leader Kublai Khan had established the Yuan dynasty in China and crushed the last Song resistance, which marked the onset of all of China under the Mongol Yuan rule. This was the first time in history that the whole of China was conquered and subsequently ruled by a foreign or non-native ruler.
In the early 1200s, Temujin, soon to be Genghis Khan, began consolidating his power in Mongolia. Following the death of the Kerait leader Ong Khan to Temujin's emerging Mongol Empire in 1203, Kerait leader Nilqa Senggum led a small band of followers into Western Xia, also known as Xi-Xia. However, after his adherents took to plundering the locals, Nilqa Senggum was expelled from Western Xia territory.
Using his rival Nilga Senggum's temporary refuge in Western Xia as a pretext, Temujin launched a raid against the state in 1205 in the Edsin region. The Mongols plundered border settlements and one local Western Xia noble accepted Mongol supremacy. The next year, 1206, Temujin was formally proclaimed Genghis Khan, ruler of all the Mongols, marking the official start of the Mongol Empire. In 1207, Genghis led another raid into Western Xia, invading the Ordo region and sacking Wuhai, the main garrison along the Yellow River, before withdrawing in 1208.
In 1209, the Genghis undertook a larger campaign to secure the submission of Western Xia. After defeating a force led by Kao Liang-Hui outside Wuhai, Genghis captured the city and pushed up along the Yellow River, defeated several cities, and besieged the capital, Yinchuan, which held a well-fortified garrison of 150,000. The Mongols, at this point inexperienced at siege warfare, attempted to flood out the city by diverting the Yellow River, but the dike they built to accomplish this broke and flooded the Mongol camp. Nevertheless, Emperor Li Anquan, still threatened by the Mongols and receiving no relief from the Jin dynasty, agreed to submit to Mongol rule, and demonstrated his loyalty by giving a daughter, Chaka, in marriage to Genghis and paying a tribute of camels, falcons, and textiles.