1-Aryl-5-amino-4-(cyanoformimidoyl)imidazoles 2 were reacted with malononitrile under mild experimental conditions and led to 3-aryl-5,7-diamino-6-cyano-3H-imidazo[4,5-b]pyridines 5, when the reaction was carried out in the presence of DBU, or to 3-aryl-5-amino-6,7-dicyano-3H-imidazo[4,5-b]pyridines 3, in its absence. Both reactions evolved from the adduct formed by nucleophilic attack of the malononitrile anion to the carbon of the cyanoformimidoyl substituent. A 5-amino-1-aryl-4-(1-amino-2,2-dicyanovinyl)imidazole 4 was isolated when this reaction was carried out in the presence of DBU. The structure of compound 4 was confirmed by spectroscopic methods and by reaction with triethyl orthoformate and with acetic anhydride, leading respectively to 9-aryl-6-(cyanomethylidene)purines 11 and 12. Imidazole 2b was also reacted with ethyl acetoacetate, a carbon acid with a pK(a) comparable to that of malononitrile. Similar reaction conditions were used and the product isolated was a 6-carbamoyl-1,2-dihydropurine 10, showing that a different mechanism was operating in this case.