Burhan ad-Din, a Khoja of the White Mountain faction, was the grandfather of Jahangir.[3] Before rebellion broke out in May 1826 and during a fortuitously timed earthquake that destroyed most towns in the Ferghana Valley, Jahangir Khoja managed to flee to Kashgar from Kokand, where he had been held in prison in accordance with a secret agreement concluded between the Khanate of Kokand and Qing dynasty China concerning descendants of Appak khoja.[note 1] Among Jahangir's troops were Kirghiz, Tajiks and White Mountain fighters. After appearing in Kashgar with only several hundred of his followers, he quickly increased his force with volunteers, and within several months had collected about 200,000 troops under his banner.[note 2] Jahingir overthrew Qing power in Kashgar, Yarkand, Khotan and Yangihissar, having annihilated the Qing garrisons in these cities.