Resources of coal-derived gas in the deep strata are found abundant in China. Recent advances in petroleum geochemistry suggest water may contribute hydrogen and oxygen to the formation of hydrocarbons and oxygenated alteration production. However, the role of water during gas generation has been in debate due to conflicting research results. In this study, a Jurassic coal sample from the Kuqa depression, Tarim Basin, China was artificially matured by nonhydrous pyrolysis and hydrous pyrolysis at isothermal (330 °C, 350 °C, 370 °C for 72h) and non-isothermal (440 °C, 470 °C and 500 °C at heating rate of 2 °C/h) temperatures. Both isothermal and non-isothermal experiments generated more methane but less C3-5 hydrocarbon gases and CO2 non-hydrocarbon gas in the nonhydrous system relative to hydrous conditions. In the isothermal experiment, the nonhydrous pyrolysis generated at most 24% more methane relative to the hydrous pyrolysis, but the hydrous pyrolysis generated 5%∼87% more C3-5 hydrocarbon gas and at most 28% more CO2 relative to the nonhydrous pyrolysis. In the non-isothermal experiment, the nonhydrous pyrolysis generated 25%∼94% more methane relative to the hydrous pyrolysis, but the hydrous pyrolysis generated at most 2.56 times more C3-5 hydrocarbon gas and 1.04 times more CO2 relative to the nonhydrous pyrolysis. In general, the compositional variation trend of hydrocarbon and non-hydrocarbon gases is similar between the isothermal and non-isothermal experiments. This indicates that contribution from the supercritical water in the non-isothermal pyrolysis is not essential. With the presence of water, the secondary cracking of C3-5 alkanes in the hydrous experiments was significantly suppressed, as shown by the relatively higher yield of C3-5 alkanes in the hydrous systems. The availability of exogenous hydrogen from water in the hydrous pyrolysis inhibits the carbon-carbon bond cross linking, thus the reaction pathway of hydrocarbon generation is dominated by the thermal cracking of carbon-carbon bonds. The significant increase in CO2 in the hydrous pyrolysis indicates water is not only the source for exogenous hydrogen but also the source for the excess oxygen accounted for the formation of CO2. The overall geochemical implication of these experimental results is that it is important to consider the role of water in the hydrocarbon generation, especially in the deep strata where both geological and geochemical conditions are complex.