A novel spirobifluorene derivative SPF-TMS, which containing dithioacetal groups and triphenylamine units, was synthesized. The probing behaviors toward various metal ions were investigated via UV/Vis absorption spectra as well as one-photon fluorescence changes. The results indicated that SPF-TMS exhibits high sensitivity and selectivity for mercury ions. The detection limit was at least 8.6 × 10−8M, which is excellent comparing with other optical sensors for Hg2+. When measured by two-photon excited fluorescence technique in THF at 800 nm, the two-photon cross-section of SPF-TMS is 272 GM. Especially, upon reaction with mercury species, SPF-TMS yielded another two-photon dye SPF-DA. Both SPF-TMS and SPF-DA emit strong two-photon induced fluorescence and can be applied in cell imaging by two-photon microscopy.