Some porphyry Cu–Au deposits with relatively reduced ore assemblages, characterized by high hydrothermal pyrrhotite contents and a lack of primary hematite and magnetite, are generally considered to be associated with reduced I-type granitoids. However, the role of magmatic oxygen fugacity (fO 2 ) in controlling Cu–Au mineralization in such reduced porphyry deposits is poorly understood. The giant Late Triassic (ca 216 Ma) Pulang porphyry Cu–Au deposit of southwest China shows typical reduced ore assemblages. This study reported the systematical variation of upper crustal magmatic fO 2 of Pulang deposit, based on detailed investigations of mineral crystallization sequences and compositional features of the mineralization-related porphyries (early P1 and late P2 porphyry). Results indicate that magma of the mineralization-related porphyries experienced complex fO 2 fluctuations during its upper crustal evolution. The early primary magma had very high initial fO 2 , with ΔFMQ ≥ + 3.0 at depths of > 12 km [ΔFMQ is the deviation of logfO 2 from the fayalite–magnetite–quartz (FMQ) buffer]. The fO 2 of evolved parental magma subsequently decreased, with ΔFMQ ≤ + 1.9, due to injection of relatively reduced dioritic magmas (ΔFMQ = + 1.4 to + 2.3) from a deeper chamber (17–21 km depth) into the primary magma chamber at 10–12 km depth. Magma mixing had largely ceased at 6–10 km depth. The parental magma then ponded within the reduced Tumugou formation at a depth of ~ 3.7 km where magmatic fO 2 decreased to a moderately oxidized state (ΔFMQ = ~ + 1.6), and finally to a moderately reduced state [reflected by log(Fe 2 O 3 /FeO) ratios of < − 0.5 for P1 porphyry] due to contamination of parental magma by wall-rock Tumugou Formation. This decrease of fO 2 in the parental magma resulted in separation of magmatic sulfide, and the subsequent exsolution of reduced ore fluids responsible for the generation of Pulang ore assemblages. The fO 2 of the residual parental magma increased after exsolution of the reduced fluids to ΔFMQ values of + 3.2 to + 4.2 [also reflected by high log(Fe 2 O 3 /FeO) ratios of > − 0.5 for P2 porphyry]. Results of this study of magmatic fO 2 indicate that porphyry magmas associated with reduced Pulang ore assemblages were initially generated as highly oxidized magma which was subsequently reduced through magma mixing and contamination by reduced sedimentary rocks of the Tumugou Formation. The sharp fO 2 decrease at very shallow depth prevented the early loss of Cu and Au because the magma remained oxidized until it was emplaced at ~ 3.7 km depth. Moderately reduced magmas may thus have a genetic association with porphyry Cu–Au mineralization.