The Hanlin Academy was founded in China in the 8th century.
It was an institution meant to perform, among others, secretarial and literary tasks for the court. Only the most elite scholars were allowed to join the academy. One of its main tasks was to decide on an interpretation of the Confucian classics. This formed the basis of examinations that gave access to the higher levels of bureaucracy.
The Academy lasted until the 1911 Xinhai Revolution.