New heterocycles containing 2-aminopyrimidine moiety linked with pyrazino[1,2-c]pyrimidines, thieno[2,3-d]pyrimidines, benzimidazoles, benzothiazoles, and benzoxazoles have been prepared by an efficient method starting from N-(pyrimidin-2-yl)cyanamides.