A novel fluorescent sensor based on 5-(3-nitrophenyl)-furan-2-carbaldehyde functionalized barbituric acid derivative (QS) was successfully synthesized. QS was characterized by 1 H NMR, 13 C NMR and MS. The maximum fluorescence emission wavelength of QS in dimethyl sulfoxide (DMSO) solution was determined to be 498 nm and green fluorescence was emitted under 365 nm ultraviolet lamp. QS showed different fluorescence identification ability for aqueous solution of Hg 2+ and Fe 3+. Hg 2+ can enhance the fluorescence of probe QS to orange, and Fe 3+ quenches its fluorescence, thus realizing realtime detection. The limits of detection of QS for Hg 2+ and Fe 3+ are 3.25×10-8 and 4.0×10-8 mol• L-1 , respectively. The fluorescence measurements and MS studies suggest that the binding stoichiometry ratios of QS with Hg 2+ and Fe 3+ are recognized as 1∶1, respectively. The possible modes of QS with Hg 2+ and Fe 3+ are proposed. The addition of 2 4 H POcaused the fluorescence of QS-Fe recover, indicating that QS can be used for cyclic detection of Fe 3+. More importantly, the separation percentages of the solid QS for Hg 2+ and Fe 3+ are 92.0% and 91.8% in aqueous solution, respectively, indicating that it has excellent ingestion capacity.