Ketone (III) was prepared by Friedel-Crafts acylation of benzene (II) with 6-chloronicotinyl chloride (I). Horner-Emmons reaction of (III) with diethyl (N-methylcarbamoylmethyl)phosphonate (IV) using potassium hexamethyl-disilazide produced a 3:1 mixture of E (V) and Z olefins (VI). The desired E isomer (V) was isolated by column chromatography and then treated with bromoketone (VII) to afford the betaine (VIII). Finally, the target imidazopyridine was obtained by condensation of (VIII) with cyanamide in the presence of K2CO3.