Precise detection of Al3+ with the aid of a fluorescence sensor is of fundamental importance in the fields of water pollution control and food safety. A comprehensive understanding of the photophysical process of the sensor as well as its underlying detection mechanism is a precondition for the design of highly efficient sensors. This contribution performs a thorough investigation of the ratiometric fluorescence sensing mechanism of an Al3+ sensor with the aid of density functional theory and time-dependent density functional theory. Two excited-state intramolecular proton transfer (ESIPT) processes are observed on the S1 state potential energy surface, which leads to emission around 565 nm. A twisted intramolecular charge transfer state is observed after one of the ESIPT processes via cis-trans isomerization of the C═N bond. However, the large energy barrier hinders its occurrence, which is quite unusual. Al3+ is found to form three strong coordination bonds with the sensor, which eliminates ESIPT processes and induces a significant blue shift of the emission spectrum to 480 nm. The origination of the sensor's selectivity is also uncovered by investigating the interaction between the sensor and interfering metal ions.