major Muslim revolts in the middle of the nineteenth century which involved the Hui in Shaanxi, Gansu and Yunnan, as well as the Uyghurs in Xinjiang, do not seem to have had any direct effect on this region of the central plain." Hui Muslim officer and official Ma Xinyi served the Qing dynasty during the Dungan Revolt. Since the Shaanxi Hui rebels, in general, were not joined by the Hui in Xi'an which remained under Qing government control, the Hui of Xi'an were spared from the war by the Qing government, and from the fighting and remained in Xi'an after the war. Xi'an's walls withstood a rebel siege for two year in 1870 and 1871 and did not fall. During the Panthay Revolt, peace negotiations were held by Zhejiang and Sichuan Hui Muslims who were invited by the Qing to Yunnan in 1858 and they were not involved in the revolt. The Qing dynasty did not massacre Muslims who surrendered, the Muslim General Ma Rulong, who surrendered and join the Qing campaign to crush the rebel Muslims, was promoted, and among Yunnan's military officers serving the Qing, he was the strongest. The Qing armies left alone Muslims who did not revolt like in Yunnan's northeast prefecture of Zhaotong where there was a big Muslim population density after the war. Hui loyalists and Han both took over the land of the Shaanxi Hui who moved to Gansu and were relocated by General Zuo Zongtang to Zhangjiachuan after the war ended. Revolt in Xinjiang Pre-revolt situation By the 1860s, Xinjiang had been under Qing rule for a century. The area had been conquered in 1759 from the Dzungar Khanate whose core population, the Oirats, subsequently became the targets of genocide. However, as Xinjiang consisted mostly of semi-arid or desert lands, these were not attractive to potential Han settlers except some traders, so other people such as Uyghurs settled in the area. The whole of Xinjiang was divided into three administrative circuits: The North-of-Tianshan Circuit (), including the Ili basin and Dzungaria. This region roughly corresponds to the modern Ili Kazakh Autonomous Prefecture and included prefectures it controlled along with a few smaller adjacent prefectures. The South-of-Tianshan Circuit (). This included the "Eight cities" in turn comprising the "Four Western Cities" of Khotan, Yarkand, Yangihissar, Kashgar and the "Four Eastern Cities" (Ush, Aqsu, Kucha, Karashahr). The Eastern Circuit (), in eastern Xinjiang, centered