The Mongols began their invasion of China in 1205 with small-scale raids into the Western Xia empire. The full Mongol conquest of China spanned from 1205 to 1279. In 1211, the Mongol armies started their major attack on the Jin dynasty in northern China. They captured the Jin capital Zhongdu (present-day Beijing) in 1215. The Mongols continued expanding their control over northern China and Western Xia until the death of Genghis Khan in 1227. In 1235, the Mongols launched an attack on the Southern Song dynasty. The conquest of the Song dynasty and full control over China ended in 1279, when the last Song resistance was crushed and Kublai Khan established the Yuan dynasty, marking the first time non-Han rulers controlled all of China. Thus, the Mongol invasion of China began in earnest in 1205 and was completed in 1279 with the establishment of the Yuan dynasty under Kublai Khan.