The condensation of 4-(3-hydroxypropyl)pyridine (I) with 2,4-dinitrochlorobenzene (II) in refluxing acetone gives the pyridinum chloride (III), which is treated with 2-pyridylcarbonyl hydrazide (IV) and triethylamine in methanol yielding the dinitroaniline derivative (V). The cyclization of (V) in refluxing dioxane/water affords the pyridinium ylide (VI), which is finally reduced with NaBH4 in ethanol.