The name "Yunnan" first referred to a place when the Han dynasty created Yunnan County near modern Xiangyun.[12] During the Tang dynasty, Emperor Xuanzong gave Piluoge, the chief of Nanzhao, the title of "King of Yunnan",[13] because Nanzhao originated from Yunnan county.[14] Gradually the king of Yunnan controlled more and more territory, and "Yunnan" became the common name of this area.[15] Therefore, the Yuan dynasty created the Yunnan Province after he occupied Dali Kingdom.[13]