We use synchrotron X-ray micro-tomography to investigate the displacement dynamics during three-phase—oil, water and gas—flow in a hydrophobic porous medium. We observe a distinct gas invasion pattern, where gas progresses through the pore space in the form of disconnected clusters mediated by double and multiple displacement events. Gas advances in a process we name three-phase Haines jumps, during which gas re-arranges its configuration in the pore space, retracting from some regions to enable the rapid filling of multiple pores. The gas retraction leads to a permanent disconnection of gas ganglia, which do not reconnect as gas injection proceeds. We observe, in situ , the direct displacement of oil and water by gas as well as gas–oil–water double displacement. The use of local in situ measurements and an energy balance approach to determine fluid–fluid contact angles alongside the quantification of capillary pressures and pore occupancy indicate that the wettability order is oil–gas–water from most to least wetting. Furthermore, quantifying the evolution of Minkowski functionals implied well-connected oil and water, while the gas connectivity decreased as gas was broken up into discrete clusters during injection. This work can be used to design CO2 storage, improved oil recovery and microfluidic devices.