Iron oxide - apatite (IOA) deposits are magnetite- and apatite-rich rock assemblages that are hosted by intermediate to felsic magmatic rocks, and are frequently mined for iron. The geological formation mechanisms of IOA deposits were suggested to involve either high-temperature silicate, iron oxide and/or sulfate melts or, alternatively, hydrothermal processes at more moderate temperatures. Here, we show that magnetite and apatite samples from the type locality of the deposits in the Kiruna district, northern Sweden, contain up to tens of atom percent oxygen from evaporitic sulfate, as is demonstrated by their anomalously low Δ′17O values. In order to explain this observation in conjunction with field evidence for an igneous origin of the deposits from Kiruna, we propose that the IOA assemblage of Kiruna crystallised from iron-rich sulfate melts and/or from sulfate-rich iron oxide melts. The iron-rich sulfate melts would have formed when evaporite-rich sediments melted by anatexis and scavenged iron from magmatic sources, whereas sulfate-rich iron oxide melts could have formed, e.g., when iron oxide liquids exsolved from silicate magmas and then assimilated evaporites. An inventory study shows that several other Proterozoic and Cambrian IOA deposits have anomalously low Δ′17O values similar to Kiruna, whereas post-Cambrian IOA deposits, in contrast, have more moderate Δ′17O values. IOA deposits may therefore ubiquitously contain evaporite-derived oxygen, with variations in the lowermost Δ′17O values of the deposits reflecting the changing isotope composition of atmospheric O2 through time; and therefore providing an unexpected window into global bioproductivity and atmospheric pCO2 levels of the ancient Earth.