The Upper Devonian Shetianqiao Formation mudstones are considered to be the most petroliferous shale gas source rocks in the Shaoyang Sag of Xiangzhong Depression in China. These Shetianqiao dark mudstones have been collected systematically to investigate their geochemical characteristics by analysing their major elements, trace elements, and rare earth elements (REEs), in order to reveal their provenance, palaeoenvironment and tectonic setting. The results show that the total REEs content (ΣREE) of dark mudstone is 34.22–246.62 ppm (average 131.66 ppm) and characterized by low ΣREE, light rare earth element (LREE) enrichments, negative Eu anomalies, and minor negative Ce anomalies. The normalized distribution pattern of REE, Eu anomaly, as well as discrimination diagrams of trace elements and REEs, are applied to explain the source rock types and properties of Shetianqiao mudstones. The results indicate that the sediments have a weak sedimentary recycling and mainly originated from the upper continental crust, and the source rocks of the black mudstones are mainly constituted by felsic granite. The Ce anomaly, Th/U, V/Sc, V/Cr, and V/(Ni + V) ratios of the dark mudstones suggest a long‐term oxidizing depositional environment interrupted by a short period of a dysoxic/anoxic depositional environment in the middle section of the formation. This short period corresponds to a dramatic marine transgression with relatively high TOC. The La/Ce, LaN/SmN, Ce anomaly, and normalized REE distribution pattern characteristics indicate that the depositional process of the Shetianqiao mudstones has consistently been influenced by the regional upwelling hydrothermal activities. The chemical index of alteration (CIA) and Al2O3‐(CaO* + Na2O)‐K2O triangular plot reveal that a warm and humid climate with moderate chemical weathering in the source areas of the Shetianqiao mudstones occurred during the deposition. The ratio of major elements, trace elements, and REEs are used to analyse the tectonic setting of the depositional area which suggests that the source area is dominated by continental island arc tectonic setting. Combined with the previous regional studies, it is concluded that the continental island arc granite formed by plate collisions in the Caledonian stage constitutes the main source of the Shaoyang Sag during the Shetianqiao period. The depositional environment was not stable due to the lasting influence of deep hydrothermal activities. The upwelling currents controlled by hydrothermal activity transport nutrients to the study area, resulting in the formation of organic‐rich mudstones.