In the 4th century, northern China was largely overrun by nomadic tribes from the north. In the 320s, the Cuan (爨) clan migrated into Yunnan. Cuan Chen (爨琛) named himself king and held authority from Lake Dian, then known as Kunchuan.