The Trans-North China Orogen (TNCO) is a major Paleoproterozoic collisional belt along which the Western and Eastern Blocks of the North China Craton were amalgamated. The Lüliang Complex occurs along the western margin of this belt and incorporates several arc magmatic suites, supracrustal sequences, granitoids and charnockites. Here we investigate the Luyashan charnockite suite, as well as the surrounding granitoids, from this complex. We present results from petrology, fluid inclusions, mineral chemistry, whole rock geochemistry and zircon U–Pb and Lu–Hf isotopic studies. The charnockites are dominantly anhydrous with the typical presence of orthopyroxene. Microthermometric and laser Raman spectroscopic data on fluid inclusions in the charnockite characterize the trapped fluids as dominantly CO2 with traces of N2 and CH4. Geochemically, the charnockite suite shows compositional variation from monzogabbro through gabbroic diorite and diorite to monzodiorite. They are dominantly calc-alkaline and ferroan type and display distinct enrichment in large ion lithophile elements with depletion in HREE. They also show prominent negative anomalies of Nb, Ta, Sr and Ti, and positive anomalies of Rb, Pb, Zr and Hf indicating crustal components in the magma source. The majority of the granitoid suite shows 207Pb/206Pb mean ages in the range of 2172–2032Ma, correlating with similar ages reported from various groups in the Lüliang Complex, the formation of which is correlated with subduction along an active convergent margin. However, the charnockites which intrude the granitoids and their dioritic enclaves are clearly younger and show tightly constrained emplacement ages in the range of 1853–1872Ma. The recrystallized zircons in the older granitoids also show similar ages, suggesting a prominent thermal event at this time. These ages are close to the timing of final collision between the Western and Eastern Blocks of the North China Craton and associated high-grade metamorphism at ca. 1.85Ga. The zircon Lu–Hf isotope data reveal dominantly negative ɛHf(t) values (−8.7 to −0.1) and their TDMC (2477–3042Ma) suggest that the magma sources mainly involved Meso- to Neoarchean reworked crustal components with limited input of Paleoproterozoic juvenile components. Our study reveals that charnockite magmatism and regional metamorphism in the western margin of the TNCO broadly overlap in space and time. The geochemical features, mineral assemblages and fluid inclusion characteristics of the charnockites suggest that the rocks were derived from high temperature (900–1000°C), CO2-enriched and anhydrous (less than 3%H2O) magmas. The magma evolved into more hydrous conditions during cooling marked by the crystallization of amphiboles at 800–850°C. The geochemical features of the charnockite suite also suggest that these rocks were formed during a transitional phase from syn-subduction to collision. Such a scenario is compatible with a tectonic setting involving the subduction of an oceanic ridge when flushing of heat and CO2-rich fluids from asthenosphere into the overriding plate might have occurred through the slab window, generating hot and anhydrous magmas through melting of the basement rocks. The slab window mechanism would also account for broadly coeval high-temperature and high pressure granulites reported from the TNCO. We therefore speculate that the formation of the Luyashan charnockite suite might have been associated with ridge subduction at the terminal stage of the convergence.