The pyrrole derivatives having carbonyl groups at the C-2 position were converted to N-propargyl pyrroles. The reaction of those compounds with hydrazine monohydrate resulted in the formation of 5H-pyrrolo[2,1-d][1,2,5]-triazepine derivatives. The synthesis of these compounds was accomplished in three steps starting from pyrrole. On the other hand, attempted cyclization of a pyrrole ester substituted with a propargyl group at the nitrogen atom gave, unexpectedly, the six-membered cyclization product, 2-amino-3-methylpyrrolo[1,2-a]pyrazin-1(2H)-one as the major product. The expected cyclization product with a seven-membered ring, 4-methyl-2,3-dihydro-1H-pyrrolo[2,1-d][1,2,5]-triazepin-1-one was formed as the minor product and was converted quantitatively to the major product. The formation mechanism of the products was investigated, and the results obtained were also supported by theoretical calculations.