Synthesis, characterization and the direct use of dimethyl 3-(4-aminophenyl)indolizine-1,2-dicarboxylate (1) as a photochemical sensor for the solution phase detection of nitroaromatics are presented. Fluorescent quenching experiments depict that nitroaromatics, particularly nitrophenol derivatives, may be probed by diester 1 with a detection limit of 6.66 × 10 -8 M. FTIR and 1 H NMR studies together with fluorescent spectral analysis suggest that H-bonding interaction between 1 and p-nitrophenol (2d) triggers the formation of ground-state complex (1:2d) which causes the fluorescent quenching via electron transfer from the HOMO of electron-rich indolizine to the LUMO of electron-deficient nitrophenolics through hydrogen bonding.