The versatility of the Mukaiyama-Michael-type addition/heterocyclization of Danishefsky's diene with 1,2-diaza-1,3-butadienes was applied to the synthesis of both 4 H-1-aminopyrroles and 4,5 H-pyrazoles. Thus, the same reagents furnished different types of highly functionalized azaheterocycles essentially depending on their structure: as a matter of fact, R1 = COOR or CONR 2 differently affects the acidity of the proton at the adjacent carbon. An unexpected formation of 5 H-1-aminopyrroles from the reactions carried out in water was also observed.