The Grand Secretariat (Chinese: 內閣; pinyin: Nèigé) was nominally a coordinating agency but de facto the highest institution in the imperial government of the Chinese Ming dynasty. It first took shape after the Hongwu Emperor abolished the office of Chancellor (of the Zhongshu Sheng) in 1380 and gradually evolved into an effective coordinating organ superimposed on the Six Ministries. There were altogether six Grand Secretaries (Chinese: 內閣大學士), though the posts were not always filled. The most senior one was popularly called Senior Grand Secretary (首輔, shǒufǔ). The Grand Secretaries were nominally mid-level officials, ranked much lower than the Ministers, heads of the Ministries. However, since they screened documents submitted to the emperor from all governmental agencies, and had the power of drafting suggested rescripts for the emperor, generally known as piàonǐ (票擬) or tiáozhǐ (條旨), some senior Grand Secretaries were able to dominate the whole government, acting as de facto Chancellor.
At the beginning of the Ming dynasty, the administration adopted the Yuan dynasty's model of having only one department, the Secretariat, superimposed on the Six Ministries. The Secretariat was led by two Chancellors, differentiated as being "of the left" (senior) and "of the right" (junior), who were the head of the whole officialdom in the empire. the Hongwu Emperor was concerned that such a concentration of power in the office of Chancellors would become a serious threat to the throne. In 1380, Chancellor Hu Weiyong was executed upon accusations of treason. After that, the Hongwu Emperor eradicated the Secretariat and the posts of Chancellor; Ministers of the Six Ministries directly reported to the emperor himself.
The burden of the administrative details made it imperative for the emperor to seek secretarial assistance. In 1382, the Hongwu Emperor drew from the Hanlin Academy, an institution that provided literary and scholarly services to the court, several Grand Secretaries to process his administrative paperwork. These Grand Secretaries were assigned for duty to designated buildings within the imperial palace, and they were collectively known as the Grand Secretariat since the reign of the Yongle Emperor.