Fibroblast growth factor receptors (FGFRs) play critical roles in the regulation of cell growth, differentiation, and proliferation. Specifically, FGFR2 gene amplification has been implicated in gastric and breast cancer. Pan-FGFR inhibitors often cause large toxic side effects, and the highly conserved ATP-binding pocket in the FGFR1/2/3 isoforms poses an immense challenge in designing selective FGFR2 inhibitors. Recently, an indazole-based inhibitor has been discovered that can selectively target FGFR2. However, the detailed mechanism involved in selective inhibition remains to be clarified. To this end, we performed extensive molecular dynamics simulations of the apo and inhibitor-bound systems along with multiple analyses, including Markov state models, principal component analysis, a cross-correlation matrix, binding free energy calculation, and community network analysis. Our results indicated that inhibitor binding induced the phosphate-binding loop (P-loop) of FGFR2 to switch from the open to the closed conformation. This effect enhanced extensive hydrophobic FGFR2-inhibitor contacts, contributing to inhibitor selectivity. Moreover, the key conformational intermediate states, dynamics, and driving forces of this transformation were uncovered. Overall, these findings not only provided a structural basis for understanding the closed P-loop conformation for therapeutic potential but also shed light on the design of selective inhibitors for treating specific types of cancer.