Condensation of 3-nitrobenzenesulfonyl chloride (I) with tetrahydroquinoline (II) in the presence of pyridine gave sulfonamide (III). Reduction of the nitro group of (III) with stannous chloride produced the aniline derivative (IV). The title compound was then obtained by reductive alkylation of amine (IV) with 4-formylimidazole (V) using sodium triacetoxyborohydride as the reducing reagent.