Crystal structure of the imiquimod has been determined by single crystal X-ray analysis, imiquimod crystallizes in orthorhombic space group P2(1)2(1)2(1) and the molecules are linked along the c axis by the strong N-H ... N hydrogen bonds. A density functional theory (DFT) study on the electronic properties of imiquimod and its synthetic intermediates has been performed at B3LYP/6-31G* level, while taking solvent effects into account. Both the single configuration interaction (CIS) method and the time-dependent DFT (TDDFT) approaches have been used to calculate the electronic absorption spectra, and there is a good agreement between the calculated and experimental UV-visible absorption spectra. The fluorescence emission spectra of these three compounds in solution have also been measured, the relatively low fluorescence intensity is attributed to a chlorine-modulated heavy atom effect that enhances intersystem crossing between excited singlet and triplet states, and the relatively high fluorescence intensity of imiquimod results from an extended pi-conjugated system which enhances S(1)-->S(0) radiant transition.