The Yongzheng Emperor set it up around 1729, at first to run his war against the Dzungars in secret, which is why the name means 'office of military affairs' (
军机). It soon took policy-making away from the Grand Secretariat (
内阁), and its ministers, the
军机大臣, drafted the emperor's edicts until it was abolished in 1911.