Magmatic rocks can reveal partial melting processes in the lower crust and mantle. Therefore, the petrogenesis of both ore-barren and ore-bearing magmatic rocks can provide key insights into the deep geological processes that control porphyry Cu–(MoAu) deposits (PCDs). Here, we investigate the petrogenesis of potassic/ultrapotassic igneous rocks in the southwestern Yangtze Craton (SWYC) to constrain their magmatic sources and assess their role in the formation of PCDs. These igneous rocks can be divided into three suites, ore-barren granite porphyry, lamprophyre, and ore-bearing quartz monzonite. UPb dating of zircons indicates that these potassic/ultrapotassic intrusions crystalized simultaneously between 35.4 and 33.6 Ma. The lamprophyres have low SiO2 contents and high MgO and K2O contents, exhibiting an ultrapotassic affinity. They are depleted in high field strength elements (HFSEs; Nb, Ta, Zr, Hf, and Ti) and enriched in large ion lithophile elements (LILEs; Rb, K, Sr, and Ba). The enriched Sr, Nd, and Hf isotopic compositions of the ore-barren lamprophyres suggest that they were derived from low-degree partial melting of lithospheric mantle that had been metasomatized by subduction-related fluids during the Proterozoic. The ore-barren granite porphyries have high SiO2 and K2O contents, with high-K calc-alkaline to shoshonitic characteristics. These rocks have low MgO, Cr, Ni, and Co contents. All samples exhibit high Sr/Y ratios, and highly fractionated rare earth elements (REEs) patterns with weak Eu anomalies. Combined with their low total REE contents (75–81 ppm) and εHf(t) values, which are similar to Neoproterozoic granulite xenoliths, we conclude that the ore-barren porphyries are adakites derived from thickened Neoproterozoic lower crust. The ore-bearing intrusions show variable SiO2 and high Na2O + K2O contents, plotting in the monzonite to quartz monzonite fields in a SiO2 vs Na2O + K2O diagram. These samples have much higher total REE contents (346–671 ppm) than the ore-barren intrusions. The homogeneous SrNd isotopic compositions and linear trends on Harker diagrams suggest that the magma that formed the ore-bearing rocks underwent fractional crystallization of mainly amphibole and accessory minerals. Water contents are estimated to have been 9–12 wt% at 0.8 GPa on the basis of the retention of plagioclase and low zircon saturation temperatures, which suggests that the primitive magmas of the ore-bearing intrusions were derived from water-fluxed melting rather than dehydration melting. The additional water, required to promote water-fluxed melting, was probably derived from underplated poassic/ultrapotassic mafic magmas. The high total REE contents, Sr/Y and (La/Yb)N ratios indicate that the primitive magmas of ore-bearing intrusions were probably derived from partial melting of potassic/ultrapotassic lower crust, formed by the underplating of mantle-derived potassic/ultrapotassic magma. These results, combined with previous research, show that mantle-derived potassic/ultrapotassic magmas can provide metals and fluids required for the formation of PCDs.