We present a hybrid Car-Parrinello quantum mechanical/molecular mechanical (QM/MM) approach that is capable of treating the dynamics of molecular systems in electronically excited states in complex environments. The potential energy surface in the excited state is described either within the restricted open-shelf Kohn-Sham (ROKS) formalism or within time-dependent density functional theory (TDDFT). As a test case, we apply this technique to the study of the solvent effects on the ground state and on the first excited singlet state of acetone in water. Our results demonstrate that for this system a purely classical description of the solvent is sufficient, since inclusion of the first solvent shell of 12 water molecules into the quantum system does not show a significant effect on this transition. The excited-state energies calculated with ROKS are red shifted by a constant value compared to the TDDFT results, while the relative variations of the excitation energy for different configurations are in very good agreement. The experimentally observed blue shift of the excitation energy in going from gas phase to condensed phase is well reproduced. Excited-state dynamics carried out with ROKS yield the relaxation of the solute and the rearrangement of the solvent structure on a picosecond timescale. The calculated Stokes shift is in reasonable agreement with experimental data.