Northern Wei, which had unified northern China through the Sixteen Kingdoms period and become the first dynasty of the Northern Dynasties, largely contributed to the form of the Ritsuryo system.
その後の五胡十六国時代を経て、中国北部を統一して北朝最初の王朝となった北魏は、律令制の形成に大きく貢献した。