Iron oxide-copper-gold (IOCG) deposits are a vital source of copper and critical elements for emerging clean technologies. Andean-type IOCG deposits form in continental arcs undergoing extension, and they have a temporal relationship with magmatism although they do not exhibit a close spatial relation with the causative intrusions. The processes required to form IOCG deposits and their potential connections to iron oxideâapatite (IOA)-type mineralization remain poorly constrained, as well as the characteristics of magmatism linked to both deposit types. Here we combine zircon UâPb geochronology with zircon trace element geochemistry of intrusive rocks associated with the Candelaria deposit, one of the worldâs largest IOCG deposits, to unravel distinctive signatures diagnostic of magmatic fertility. Our results reveal a marked transition in the geochemistry of intrusions in the Candelaria district, characterized by changes in the redox state, water content and temperature of magmas over time. The oldest magmatic stage (~ 128â125 Ma), prior to the formation of the Candelaria deposit, was characterized by zircon Eu/Eu* ratios of 0.20â0.42, and redox conditions of ÎFMQ â 0.4 to + 1.0. The earliest magmatic stage related to the formation of Fe-rich mineralization at Candelaria (118â115 Ma) exhibits low zircon Eu/Eu* ratios (0.09â0.18), low oxygen fugacity values (ÎFMQ ~â 1.8 to + 0.2) and relatively high crystallization temperatures. In contrast, the youngest stage at ~ 111â108 Ma shows higher zircon Eu/Eu* (~ 0.37â0.69), higher oxygen fugacity values (ÎFMQ ~ + 0.4 to + 1.3) and a decrease in crystallization temperatures, conditions that are favorable for the transport and precipitation of sulfur and chalcophile elements. We conclude that Candelaria was formed through two distinct ore-forming stages: the first associated with a reduced, high temperature, water-poor magma developed under a low tectonic stress, followed by a more oxidized, water-rich, and low temperature magmatic event related to a compressional regime. The first event led to Fe-rich and S-poor IOA-type mineralization, while the second event with geochemical signatures similar to those of porphyry copper systems, generated the Cu- and S-rich mineralization. This late stage overprinted preexisting IOA mineralization resulting in the formation of the giant Candelaria IOCG deposit.