The hydrolysis of diethyl imidazole-4,5-dicarboxylate (I) with aqueous NaOH gives imidazole-4,5-dicarboxylic acid (II), which is partially decarboxylated by treatment with refluxing aniline yielding 4-anilinocarbonylimidazole (III). The hydrolysis of (III) with refluxing aqueous HCl affords imidazole-4-carboxylic acid (IV), which is finally esterified with ethanol and dry HCl at reflux temperature.