After the fall of the Western Jin Dynasty, Northern China split into multiple states, including the Central Asian oases. Gaochang was ruled by the Former Liang, Former Qin and Northern Liang as part of a commandery. In 383 The General Lu Guang of the Former Qin seized control of the region. In 439, remnants of the Northern Liang, led by Juqu Wuhui and Juqu Anzhou, fled to Gaochang where they would hold onto power until 460 when they were conquered by the Rouran Khaganate. Another version of this story says that in 439 a man named Ashina led 500 families from Gansu to Gaochang. In 460, the Rouran forced them to move to the Altai. They became the Ashina clan that formed the Gokturk Khaganate  Six Dynasties Turfan tombs contained dumplings. From the mid-5th century until the mid-7th century, there existed four independent statelets in the narrow Turpan basin. These were controlled by the Kan clan, Zhang clan, Ma clan and Qu clan. A the time of its conquest by the Rouran Khaganate, there were more than ten thousand Han Chinese households in Gaochang. The Rouran Khaganate, which was based in Mongolia, appointed a Han Chinese named Kan Bozhou to rule as King of Gaochang in 460, and it became a separate vassal kingdom of the Khaganate. Kan was dependent on Rouran backing. Yicheng and Shougui were the last two kings of the Chinese Kan family to rule Gaochang. At this time the Gaoche () was rising to challenge power of the Rouran in the Tarim Basin. The Gaoche king Afuzhiluo () killed King Kan Shougui, who was the nephew of Kan Bozhou. and appointed a Han from Dunhuang, named Zhang Mengming (張孟明), as his own vassal King of Gaochang. Gaochang thus passed under Gaoche rule. Later, Zhang Mengming was killed in an uprising by the people of Gaochang and replaced by Ma Ru (). In 501, Ma Ru himself was overthrown and killed, and the people of Gaochang appointed Qu Jia () of Jincheng (in Gansu) as their king. Qu Jia hailed from the Zhong district of Jincheng commandery (金城, roughly corresponding to modern day Lanzhou, Gansu) Qu Jia at first pledged allegiance to the Rouran, but the Rouran khaghan was soon killed by the Gaoche and he had to submit to Gaoche overlordship.