 At the end of the Han dynasty, most of Hebei came under the control of warlords Gongsun Zan in the north and Yuan Shao further south; Yuan Shao emerged victorious of the two, but he was soon defeated by rival Cao Cao (based further south, in modern-day Henan) in the Battle of Guandu in 200.Hebei then came under the rule of the Kingdom of Wei (one of the Three Kingdoms), established by the descendants of Cao Cao.After the invasions of northern nomadic peoples at the end of the Western Jin dynasty, the chaos of the Sixteen Kingdoms and the Northern and Southern dynasties ensued.