The mechanical behavior of rock under conditions of multiphase fluids is currently a key scientific issue in the field of geotechnical engineering. In this work, we conducted triaxial compression experiments of initially water‐saturated samples, which were flooded with CO2 using the semipermeable separator method; comparatively investigated the mechanical behaviors of sandstone under the conditions of mono‐phase fluids CO2/N2/H2O and biphase fluid CO2‐H2O; and analyzed the stress‐strain characteristics, internal crack expansion, and macrocrack failure patterns of sandstones. Compared with H2O, CO2 and N2 could lead sandstone cracks to show a pattern of multiple fractures, displaying a double shear failure mode and multiple branch cracks along principal fractures. Moreover, the cracking effect of supercritical CO2 was more evident. Under the conditions of pore pressure of 10 MPa and temperature of 323 K, the ratio of work done by CO2, N2 and H2O during crack expansion was 23.5:24.1:1, with transient pressure drops to 7.82 MPa, 9.25 MPa, and 0.1 MPa, respectively. Overall, the study analyzed the mechanisms of physicochemical interactions of fluid types and the number of phases in sandstone minerals at the microscale and revealed the mechanical mechanism between fluids and rock minerals, as well as the impacts of these fluids on the strength, internal crack expansion and deformation of sandstone. © 2017 Society of Chemical Industry and John Wiley & Sons, Ltd.