Cao Wei (Chinese: 曹魏; pinyin: Cáo Wèi; Wade-Giles: Ts'ao Wei) was one of the regimes that competed for control of China during the Three Kingdoms period. It was established by Cao Cao, who had become the most powerful military leader in northern and central China. After 213, Cao Cao's feudal holdings were given the name Wei; historians often add the prefix Cao (from Cao Cao's family name) to distinguish it from the other states in Chinese history also known as Wei, such as the earlier State of Wei during the Warring States Period, and the later Northern Wei state. In 220, when Cao Cao's son deposed the last emperor of the Han Dynasty, Wei became the name of the new dynasty he founded.
During the decline of the Han Dynasty, the northern part of China was under the control of Cao Cao, the Imperial Chancellor to the last Han emperor (see Unification of northern China). In 213, he was titled the "Duke of Wei" and given ten cities as his domain. This area was named the "State of Wei". At that time, the southern part of China was already divided into two areas controlled by two warlords (later the Kingdom of Shu and Kingdom of Wu). In 216, Cao Cao was promoted to "King of Wei". In March 15 of 220, Cao Cao died and his son Cao Pi succeeded to the title "King of Wei" and the position as Imperial Chancellor. Later that year in December 11, Cao Pi seized the imperial throne and claimed to have founded the Wei Dynasty, but Liu Bei of Shu Han immediately contested his claim to the throne, and Sun Quan of Eastern Wu followed suit in 222. Wei conquered Shu Han in 263. Shortly afterwards, in 265, the Wei dynasty was overthrown by its last Imperial Chancellor, Sima Yan, grandson of Sima Yi, who then founded the Jin Dynasty.