Sequential reaction of 2-chlorobenzaldehyde, cyanothioacetamide, and malononitrile dimer in the presence of an excess of N-methylmorpholine resulted in the formation of N-methylmorphlinium salt of 2-amino-4-(2-chlorophenyl)-6-(dicyanomethyl)-1,4-dihydropyridine-3,5-dicarbonitrile. The resulting salt reacts under Mannich conditions with primary amines and an excess of formaldehyde to form substituted 2-alkylamino-4-(dicyanomethylene)-3,7-diazabicyclo[3.3.1]non-2-ene-1,5-dicarbonitriles. Structure of the key compound was confirmed by single crystal X-ray diffraction analysis.