1,5 Dinitro 3,7 diazabicyclo[3.3.1]nonane derivatives were synthesized in up to 83% yields by the Mannich reaction of 1,3 dinitropropanes with excess formaldehyde and primary amines. In some cases, for instance, when 2,2 dimethyl 1,3 dinitropropane and benzylamine or monoethanolamine are used, the reaction occurs with low yields or stops at the step of forma tion of 3,5 dinitropiperidines. The influence of the structure of the starting compounds and reaction conditions on the yields of 1,5 dinitro 3,7 diazabicyclo[3.3.1]nonanes and 3,5 dinitropiperidines was studied.