Selective CO 2 capture is of great significance for environmental protection and industrial demand. Here, we report a stable and flexible metal−organic framework (MOF) with excellent water/moisture stability, namely, ZnDatzBdc, that enables high-performance selective CO 2 capture from N 2 and CH 4 via a discriminatory gate-opening effect. ZnDatzBdc shows reversible structural transformation between the open-phase (OP) state and the close-phase (CP) state, owing to the synergistic effect of breakage/re-formation of intraframework hydrogen bonds and the rotation of the phenyl rings. Significantly, ZnDatzBdc exhibits S-shaped isotherms toward CO 2 , resulting in a large CO 2 theoretical working capacity of 94.9 cm 3 /cm 3 under typical pressure vacuum swing adsorption (PVSA) operations, which outperforms other flexible MOFs showing the CO 2 selective gate-opening effect except for the miosture-sensitive ELM-11. In addition, CO 2 uptake of ZnDatzBdc is well maintained upon multiple water/moisture exposure, indicating its excellent stability. Moreover, ZnDatzBdc establishes remarkable CO 2 selectivity with ultrahigh uptake ratios of CO 2 /N 2 (107 at 273 K and 129 at 298 K) and CO 2 /CH 4 (35 at 273 K and 44 at 298 K) at 100 kPa. The in situ gas sorption PXRD experiment verifies that the gate-opening effect takes place in the atmospheric environment of CO 2 but not for N 2 or CH 4 . Molecular simulation suggests the selective gate-opening of CO 2 comes from its strong electrostatic interactions with the amino groups. Furthermore, effective breakthrough performance and easy regeneration are further confirmed. Hence, combined with excellent separation performance and remarkable stability, ZnDatzBdc can serve as a potential industrial adsorbent for selective CO 2 capture.