The military history of the Jin dynasty and the Sixteen Kingdoms encompasses the period of Chinese military activities from 266 AD to 420 AD. The Jin dynasty is usually divided into the Western Jin and Eastern Jin in Chinese historiography. Western Jin lasted from its usurpation of Cao Wei in 266 to 316 when the Uprising of the Five Barbarians split the empire and created a number of barbarian states in the north. The Jin court relocated to Jiankang, starting the era of Eastern Jin, which ended in 420 when it was usurped by Liu Yu, who founded the Liu Song dynasty.