In 1227, Genghis Khan's army attacked and destroyed the Tangut capital of Ning Hia and continued to advance, seizing Lintiao-fu, Xining province, Xindu-fu, and Deshun province in quick succession in the spring. At Deshun, the Tangut general Ma Jianlong put up a fierce resistance for several days and personally led charges against the invaders outside the city gate. Ma Jianlong later died from wounds received from arrows in battle. Genghis Khan, after conquering Deshun, went to Liupanshan (Qingshui County, Gansu Province) to escape the severe summer. The new Tangut emperor quickly surrendered to the Mongols, and the rest of the Tanguts officially surrendered soon after. Not happy with their betrayal and resistance, Genghis Khan ordered the entire imperial family to be executed, effectively ending the Tangut lineage.