A combination of excited-state intramolecular proton transfer (ESIPT) and aggregation-induced emission (AIE) has opened new opportunities to develop color-tunable luminescent materials with high quantum yield. Understanding the emission mechanism of these luminophores is essential for the molecular design and construction of a functional system. Herein, we report QM (MS-CASPT2//TD-DFT, MS-CASPT2//CASSCF) and ONIOM (QM/MM) studies on the fluorescence quenching and AIE mechanisms of 2-(2-hydroxy-phenyl)-4(3H)-quinazolinone with typical characteristics of AIE and ESIPT as an example. The computational results indicate that in the tetrahydrofuran solution, once being excited to the S-1 state, the molecule tends to undergo an ultrafast, barrierless ESIPT from enol to keto tautomer and then accesses a S-1/S-0 conical intersection in the vicinity of a C=C bond twisted intramolecular charge-transfer (TICT) intermediate, leading to a nonradiative decay from the excited to ground state. Hence, the TICT-induced nonadiabatic transition, which has been further confirmed by the on-the-fly trajectory surface hopping dynamics simulations, accounts for the fluorescence quenching in solution. In contrast, in the solid state, the nonradiative relaxation pathway via the C=C bond rotation is suppressed due to environmental hindrance, leaving the ESIPT-induced enol-keto tautomerization as the only excited-decay channel, thus the fluorescence is observably enhanced in the crystal.