The reactions of 1-aryl-4-hydrazinocarbonyl-2-pyrrolidinones with 2,4-pentanedione and 2,5-hexanedione have been studied. It was found that heating the hydrazinocarbonyl compounds with 2,4-pentanedione gave 3,5-dimethylpyrazole compounds and with 2,5-hexanedione gave 1-substituted 2,5-dimethylpyrroles.