In the chaos following the fall of the Han Dynasty, the former Han commanderies had broken free of control and were ruled by various independent warlords. Surrounded by these commanderies, who were governed by aggressive warlords, Goguryeo moved to improve relations with the newly created dynasty of Cao Wei in China and sent tribute in 220. In 238, Goguryeo entered into a formal alliance with Wei to destroy the Liaodong commandery.