Pyridin-2-yl- and 4,6-dimethylpyrimidin-2-yl-cyanamides entered into an alkylation reaction in the form of sodium salts. Pyridin-2-yl cyanamide 2 was alkylated at endo-nitrogen atom of pyridine ring, while 4,6-dimethylpyrimidin-2-yl cyanamide 1 was effectively alkylated at exo-nitrogen atom of amino cyanamide group. The alkylation of cyanamides 1 and 2 with phenacylbromide gave the corresponding acetophenone derivatives. As a result of their intramolecular cyclization reactions 3-(4,6-dimethylpyrimidin-2-yl)-5-phenyloxazol-2(3H)-imine in the case of cyanamide 1 and 2-amino-3-benzoylimidazo[1,2-a]pyridine in the case of cyanamide 2 were formed. The alkylated derivatives of pyridin-2-ylcyanamide 2 possess visible blue fluorescence with the main peak at 421 – 427 nm.