We report new U–Pb zircon age data, zircon in situ oxygen isotope, mineral chemistry, whole-rock geochemistry and Sr–Nd isotopic compositions from the Early Devonian ultrapotassic Gucheng pluton in the North China Craton, and discuss its petrogenesis. The Gucheng pluton is exposed in the northern part of the North China Craton and forms a composite intrusion, consisting of K-feldspar-bearing clinopyroxenite, clinopyroxene-bearing syenite and alkali-feldspar syenite. Mineral phases in these lithologies include clinopyroxene (Wo43–48En19–35Fs18–38), sanidine (An0Ab3–11Or89–97), and subordinate titanite, andradite and Na-feldspar. These rocks show homogeneous Sr but variable Nd isotopic compositions, and have relatively high zircon in situ oxygen isotopes (δ18O = 5.2–6.7). The Gucheng plutonic rocks formed through fractional crystallization and accumulation from ultrapotassic magmas, which were originated from partial melting of metasomatic vein systems in the subcontinental lithospheric mantle of the North China Craton. These vein networks developed as a result of the reactions of fluids derived from subducted pelitic sediments on the downgoing Palaeo-Asian ocean floor with the enriched, subcontinental lithospheric mantle peridotites. Sensitive high-resolution ion microprobe (SHRIMP) U–Pb zircon dating has revealed a crystallization age of 415 Ma for the timing of the emplacement of the Gucheng pluton that marks the early stages of alkaline magmatism associated with the Andean-type continental margin evolution along the northern edge of the North China Craton facing the Palaeo-Asian Ocean.