We imaged sandstone cores at residual gas saturation (Sgr) with synchrotron radiation at a nominal resolution of (9 μm)3. We studied two three-phase flooding sequences: (1) gas injection into a core containing oil and initial water followed by a waterflood (gw process); (2) gas injection into a waterflooded core followed by another waterflood (wgw process). In the gw flood we measured a significantly higher Sgr(=20.6%; Sgr in the wgw flood was 5.3%) and a significantly lower residual oil saturation (Sor; Sor in the gw flood was 21.6% and Sor in the wgw flood was 29.3%). We also studied the size distribution of individual trapped clusters in the pore space. We found an approximately power-law distribution N ∝ s−τ with an exponent τ = 2.02–2.03 for the residual oil clusters and τ = 2.04 for the gas clusters in the gw flood. τ (=2.32) estimated for the gas clusters in the wgw process was significantly different. Furthermore, we calculated the surface area A–volume V relationships for the clusters. Again an approximate power-law relationship was observed, A ∝ Vp with p ≈ 0.75. Moreover, in the gw flood sequence we identified oil layers sandwiched between the gas and water phases; we did not identify such oil layers in the wgw flood. These results have several important implications for oil recovery, carbon geo-sequestration and contaminant transport: (a) significantly more oil can be produced and much more gas can be stored using a gw flood; (b) cluster size distributions for residual oil or gas clusters in three-phase flow are similar to those observed in analogue two-phase flow; (c) there is a large cluster surface area available for dissolution of the residual phase into an aqueous phase; however, this surface area is significantly smaller than predicted by percolation theory (p ≈ 1), which implies that CO2 dissolution trapping and contamination of aquifers by hazardous organic solvents is slower than expected because of reduced interfacial contact areas.