The dolomite-hosted, Lower Triassic Feixianguan Formation from the northeast Sichuan Basin, China, is an economically important reservoir that contains sour natural gas. These reservoirs were initially filled with oil, later replaced by gas during burial to 7000 m (22,965 ft) followed by uplift to about 4000 m (13,123 ft). We have studied the souring process (thermochemical sulfate reduction [TSR]) and diagenetic evolution of the Feixianguan Formation using detailed petrology, fluid-inclusion studies, and stable-isotope data from carbonate minerals. Pre-TSR diagenesis included (in time order) the eodiagenetic main stage of dolomitization by a reflux mechanism; fracture-related calcite cementation; barite, quartz, celestite, and fluorite mineralization; and a dolomite recrystallization stage. Thermochemical sulfate reduction resulted in anhydrite replacement by calcite, petroleum destruction, formation of sulfur-rich pyrobitumen and elemental sulfur, and generation of large volumes of and . Diagenesis during TSR can be subdivided into oil-stage TSR and gas-stage TSR, with oil-stage TSR defined by the presence of primary oil and bitumen inclusions in the TSR calcite. Based on aqueous inclusion homogenization temperatures, oil-stage TSR commenced at a temperature of 116°C, with a mode between 130°C and 140°C. Gas-stage TSR started at a temperature of 135°C and continued to maximum burial temperatures of about 220°C. Trace amounts of pyrite, barite, quartz, and celestite grew during TSR. Post-TSR diagenesis was dominated by fracture-related calcite precipitation as well as celestite and anhydrite crystallization. Formation water salinity increased from depositional values (3.5 wt. %) up to 24 wt. % during pre-TSR dolomite recrystallization probably because of an influx of evaporite-associated water from the overlying Jialingjiang Formation, although pre-TSR barite, quartz, celestite, and fluorite mineralization was associated with a transient decrease in water salinity. During TSR, formation water salinity decreased from 26 wt. % to as low as 4 wt. % as a result of water being produced during TSR reactions.