The reaction of 2-chloro-3-nitropyridine (I) with piperidine (II) in dichloromethane gives 3-nitro-2-(1-piperidinyl)pyridine (III), which is cyclized by means of anhydrous ZnCl2 in refluxing acetic acid yielding the acetoxy dipyridoimidazole (IV). The deacetylation of (IV) with NaOH in methanol affords the alcohol (V), which is oxidized with oxalyl chloride and DMSO in dichloromethane to give the ketone (VI). The bromination of (VI) with Br2 in hot aqueous HBr yields the alpha-bromoketone (VII), which is finally cyclized with N,N-dimethylthiourea (VIII) in refluxing ethanol.