Sensor 1 (a Schiff base) obtained by the condensation of 4-nitro-o-phenyldiamine and 2-hydroxy-1-naphthaldehyde can detect fluoride ion selectively through visual color change. Moreover, insitu cyclisation of sensor 1 to benzimidazole derivative 2 takes place by the help of fluoride ion as evidenced by X-ray crystal structure. The crystal structures of the sensor 1 and benzimidazole derivative 2 show that several types of weak C-H...X (X = O, N), C-H...π and π...π interactions play a crucial role along with intra/inter molecular H-bonding interactions for the stabilization of crystal lattice. © 2015 Elsevier B.V. All rights reserved.