It consists of the reaction of a primary amine with a 3-ketoester forming an imine, which later tautomerizes to enamnin, attacking an a-haloketone. In a subsequent cyclization stage, pyrrole is obtained.

hantzsch pyrrole synthesis 01

Mechanism:

Step 1. Formation of the enamine

hantzsch pyrrole synthesis 02

Step 2. Attack of the enamine on the a -haloketone

hantzsch pyrrole synthesis 03

Step 3. Cycling

hantzsch pyrrole synthesis 04

Stage 4. Dehydration

hantzsch pyrrole synthesis 05