The gas charging influences on dissolution, cementation, and clay transformation are still largely unknown during the migration and accumulation of hydrocarbons. The reservoirs in the upper Huangliu Formation of the XF13 block in the Yinggehai Basin, South China Sea, were charged by CO2 and gaseous hydrocarbons, offering us an ideal opportunity to quantitatively study the diagenetic differences caused by gas charging with different compositions. The techniques and methods used in this study include optical microscopy, scanning electron microscopy, cathodoluminescence, x-ray diffraction, chemical analysis of formation water, stable isotope analyses, and fluid inclusion examination. These analyses demonstrate that the late-stage charging of CO2-rich thermal fluid in the wells near the diapir zone modified porosity, permeability, temperature, fluid pH, and contents of K+, Na+, Mg2+, Fe2+, and other ions. Natural gas accumulations with high maturity and high CO2 contents presented at wells XF13A and XF13B near the diapir zone resulted from episodic mixing and modification. Wells far from the diapir zone (e.g., XF13E and XF13F) mostly show alkane enrichment. Late-stage charging of CO2-rich thermal fluids at wells XF13A and XF13B (in a closed system with episodic semiopen events) has resulted in significant dissolution and caused reservoirs with high porosity but low permeability. In contrast, wells far from the diapir zone were only charged by early-stage hydrocarbons, and the porosity and permeability are relatively high. This study is important in predicting reservoir quality according to gas compositions of reservoirs.