Originally created in 765 in the Tang dynasty for eunuchs to coordinate and supervise the emperor's paperwork, this post grew in importance since the 870s as eunuchs dominated the imperial Tang government. After the Tang dynasty fell in the beginning of the 10th century, shumishi was no longer restricted to eunuchs and indeed was the title of some of highest officeholders in many Five Dynasties and Ten Kingdoms period (907–979) states. In the Song dynasty (960–1279), a shumishi was a military affairs commissioner in charge of the entire national military.