The Jin dynasty or Jin Empire, sometimes distinguished as the Sima Jin or the Two Jins, was an imperial dynasty in China that existed from 266 to 420. It was founded by Sima Yan, eldest son of Sima Zhao, who had previously been declared the King of Jin. There are two main divisions in the history of the dynasty. The Western Jin (266–316) was established as the successor to Cao Wei after Sima Yan usurped the throne from Cao Huan. The capital of the Western Jin was initially in Luoyang, though it later moved to Chang'an. In 280, after conquering Eastern Wu, the Western Jin ended the Three Kingdoms period and reunited China proper for the first time since the end of the Han dynasty.