The pseudo-Michael reaction of 1-aryl-4,5-dihydro-1H-imidazol-2-amines with ethyl 2-cyano-3-methoxyprop-2-enoate (ethyl ethoxymethylenecyanoacetate) is investigated. At −10 °C reaction takes place on the exocyclic nitrogen atom, giving exclusively ethyl esters of 2-cyano-3-[(1-phenyl-4,5-dihydro-1H-imidazol-2-yl)amino]prop-2-enoic acid. The formation of isomeric enamines which may be a theoretical product of the reaction on N3 ring nitrogen atom is not observed. The N6 enamines, heated in boiling acetic acid, yield cyclic 1-aryl-5-oxo-2,3-dihydroimidazo[1,2-a]pyrimidine-6-carbonitriles. Heating of the enamines to the temperature of 120–140 °C without a solvent makes it possible to obtain a mixture of 1-aryl-5-oxo-2,3-dihydroimidazo[1,2-a]pyrimidine-6-carbonitriles and ethyl 1-aryl-5-imino-2,3-dihydroimidazo[1,2-a]pyrimidine-6-carboxylates. The reaction of the respective hydrobromides of 1-aryl-4,5-dihydro-1H-imidazol-2-amines with ethyl ethoxymethylenecyanoacetate in the presence of triethylamine gives selectively 1-aryl-5-oxo-1,2,3,5-dihydroimidazo[1,2-a]pyrimidine-6-carbonitriles.Graphical Abstract