The reaction of 4-(1H-imidazol-1-yl)benzaldehyde (I) with morpholine (A) and KCN in dioxane water by means of p-toluenesulfonic acid gives [4-(1H-imidazol-1-yl)phenyl](4morpholinyl)acetonitrile (II), which is condensed with crotononitrile (III) by means of KOH in methanol yielding 4-[4-(1H-imidazol-1-yl)phenyl]-3-methyl-4-oxobutyronitrile (IV). The hydrolysis of (IV) with hot aqueous HCl affords 4-[4-(1H-imidazol-1-yl)phenyl]-3-methyl-4-oxobutanoic acid (V), which is finally cyclized with hydrazine in refluxing ethanol.