1,3,5,7-Tetranitro-1,3,5,7-tetraazacyclooctane (HMX) is one of the most powerful and widely used explosives. 3,7-Dinitro-1,3,5,7-tetraazabicyclo[3.3.1] (DPT) is an important precursor in the production of HMX. A new reaction mechanism including nitrolysis, nitrosolysis and nitrolysis processes in fuming HNO 3 was put forward. The stable key intermediate 1-nitroso-3,5,7-trinitro-1,3,5,7tetraazacyclooctane (MNX) was isolated and characterized. Based on the new mechanism, a stepwise method to pre-pare HMX from DPT was developed. The influence factors on the yields of MNX such as reaction temperature, loading amounts of HNO 3 , NaNO 2 and NH 4 NO 3 were investigated. Under the optimized conditions, MNX was obtained with a satisfactory yield of 84.0 %. MNX could be efficiently and smoothly nitrolyzed in fuming nitric acid and afforded pure b-HMX with excellent yield up to 92.8 %. The overall yield of the stepwise procedure was as high as 78.0 %, much higher than traditional one-pot nitrolysis protocols.