Pyrimidino[4,5-b][1,5]benzodiazepinones 4 and pyrimidino [1,6-a]benzimidazolones 5 were synthesized from 4-ethoxycarbonylamino-1H-1,5-benzodiazepine-3-carbonitrile (2) via ring transformation with some aliphatic primary amines. The reaction mechanisms for the formation of these compounds are proposed.