Porphyry-type Cu (Mo, Au) deposits are among the economically most important ore resources. The depth and mode of ore-forming fluid exsolution from their source magmas has remained poorly constrained. Here, we studied 36 magmatic rocks from six mineralized systems in the Sanjiang region of southwestern China. Melt inclusions trapped in the phenocrysts of mineralizing, felsic magmas are strongly depleted in Cl, S, and metals. Petrographic evidence, apatite volatile contents, and mass balance calculations suggest that this depletion was caused by the exsolution of aqueous fluids, which extracted 63‒97% of the Cl, S, and metals originally present in the magmas. Three independent geobarometers reveal that all the major phenocrysts in the felsic magmas crystallized within the pressure range of 0.3‒0.5 GPa. These results show that the ore-forming fluids exsolved from magmas that crystallized at mid- to upper crustal depths of ~10‒20 km, rather than from magmas crystallizing entirely within the upper crust or from magmas directly ascending from the lower crust. The fluids thus had to transport their metal and S endowments over a vertical distance of ~10 km to the site of ore precipitation, likely first via bubbles suspended in ascending porphyry magmas, and then through an interconnected fluid network.