The Chinese imperial examination system was an important institutional creation that promoted meritocracy in the Imperial China. However, the impartiality of the merit-based selection process could be damaged by the top officials in the central government. This paper examines the favoritism in the imperial examination of the Ming dynasty. The results find that examinees from the same prefecture or the same province as the grand secretaries were more likely to obtain higher tiers of the jinshi degree in the palace examination and they were more likely to be selected as the interns in the Hanlin Academy, which guaranteed them more promising official careers. The senior grand secretary had larger influence than the secondary grand secretaries. The favoritism from the grand secretaries was also limited by the bureaucracy as the study finds limited influence of the grand secretaries on the lower metropolitan exams. Therefore, China’s meritocracy was impaired by the favoritism in the civil service examination system.