The origin of the modern meritocratic civil service can be traced back to Imperial examination founded in Imperial China. The Imperial exam based on merit was designed to select the best administrative officials for the state's bureaucracy. This system had a huge influence on both society and culture in Imperial China and was directly responsible for the creation of a class of scholar-bureaucrats irrespective of their family pedigree.
Originally appointments to the bureaucracy were based on the patronage of aristocrats; During Han dynasty, Emperor Wu of Han established the xiaolian system of recommendation by superiors for appointments to office. In the areas of administration, especially the military, appointments were based solely on merit. This was an early form of the imperial examinations, transitioning from inheritance and patronage to merit, in which local officials would select candidates to take part in an examination of the Confucian classics. After the fall of the Han dynasty, the Chinese bureaucracy regressed into a semi-merit system known as the nine-rank system.
This system was reversed during the short-lived Sui dynasty (581–618), which initiated a civil service bureaucracy recruited through written examinations and recommendation. The first civil service examination system was established by Emperor Wen of Sui. Emperor Yang of Sui established a new category of recommended candidates for the mandarinate in AD 605. The following Tang dynasty (618–907) adopted the same measures for drafting officials, and decreasingly relied on aristocratic recommendations and more and more on promotion based on the results of written examinations.The structure of the examination system was extensively expanded during the reign of Wu Zetian The system reached its apogee during the Song dynasty.
In theory, the Chinese civil service system provided one of the major outlets for social mobility in Chinese society, although in practice, due to the time-consuming nature of the study, the examination was generally only taken by sons of the landed gentry. The examination tested the candidate's memorization of the Nine Classics of Confucianism and his ability to compose poetry using fixed and traditional forms and calligraphy. In the late 19th century the system came under increasing internal dissatisfaction, and it was criticized as not reflecting the candidate's ability to govern well, and for giving precedence to style over content and originality of thought. The system was finally abolished by the Qing government in 1905 as part of the New Policies reform package.