Process for the preparation of heterocycles by reacting 2-substituted acetals of malondialdehyde with a reactant selected from hydroxylamines and their salts, hydrazines and their salts, formamid, amidines and their salts, guanidines and their salts, aminoguanidines and their salts, nitroguanidine and their salts, O-alkyl-isoureas and their salts, O-cycloalkyl-isoureas and their salts, O-aralkyl-isoureas and their salts, O-aryl-isoureas and their salts, S-alkyl-isothioureas, S-cycloalkyl-isothioureas, S-aralkyl-isothioureas, S-arylisothioureas, S-alkyl-isothiouronium salts, S-cycloalkyl-isothiouronium salts, S-aralkyl-isothiouronium salts, S-aryl-isothiuronium salts, thiourea and urea.