From the Sui–Tang transition around 605 CE, the imperial keju examinations began recruiting officials by competitive written tests on the Confucian classics rather than by birth alone, and the Song dynasty greatly expanded the system from the tenth century. Candidates progressed through prefectural, provincial and palace examinations, and successful graduates staffed a salaried scholar-bureaucracy that administered the empire. The system created a literate governing elite whose status rested on examined learning. It coexisted with, but increasingly displaced, hereditary aristocratic office-holding.
It produced a centralised, literate administrative class able to register land, tax households and plan and provision capitals at imperial scale. This professional bureaucracy gave the Chinese state an unusual capacity for sustained, systematic urban administration.