A novel and efficient base-catalyzed, transition-metal-free method for the synthesis of diheterocyclic compounds connected by an amidine linker, including apart from the common 1,2,3-triazole ring, either an additional pyrimidinedione, 4-nitroimidazole, isoxazole, 1,3,4-triazole, 2-oxochromone or thiazole ring, has been developed. The process was facilitated by a strong base and includes the cycloaddition reaction of 3,3-diaminoacrylonitriles (2-cyanoacetamidines) to heterocyclic azides followed by a Cornforth-type rearrangement to the final products. The reaction is tolerant to various N-monosubstituted 3,3-diaminoacrylonitriles and to different heterocyclic azides. The developed method has a broad scope and can be applied to obtain a variety of N-heteroaryl-1,2,3-triazole-4-carbimidamides with alkyl, allyl, propargyl, benzyl, cycloalkyl, and indolyl substituents at the N1 position .