Magma-carbonate interaction is an increasingly recognised process occurring at active volcanoes worldwide, with implications for the magmatic evolution of the host volcanic systems, their eruptive behaviour, volcanic CO2 budgets, and economic mineralisation. Abundant calc-silicate skarn xenoliths are found at Merapi volcano, Indonesia. We identify two distinct xenolith types: magmatic skarn xenoliths, which contain evidence of formation within the magma, and exoskarn xenoliths, which more likely represent fragments of crystalline metamorphosed wall-rocks. The magmatic skarn xenoliths comprise distinct compositional and mineralogical zones with abundant Ca-enriched glass (up to 10 wt% relative to lava groundmass), mineralogically dominated by clinopyroxene (En15-43Fs14-36Wo41-51) + plagioclase (An37-100) ± magnetite in the outer zones towards the lava contact and by wollastonite ± clinopyroxene (En17-38Fs8-34Wo49-59) ± plagioclase (An46-100) ± garnet (Grs0-65Adr24-75Sch0-76) ± quartz in the xenolith cores. These zones are controlled by Ca transfer from the limestone protolith to the magma and by transfer of magma-derived elements in the opposite direction. In contrast, the exoskarn xenoliths are unzoned and essentially glass-free, representing equilibration at sub-solidus conditions. The major mineral assemblage in the exoskarn xenoliths is wollastonite + garnet (Grs73-97Adr3-24) + Ca-Al-rich clinopyroxene (CaTs0-38) + anorthite ± quartz, with variable amounts of either quartz or melilite (Geh42-91) + spinel. Thermobarometric calculations, fluid inclusion microthermometry and newly calibrated oxybarometry based on Fe3+/ΣFe in clinopyroxene indicate magmatic skarn xenolith formation conditions of ∼850 ± 45 °C, < 100 MPa and at an oxygen fugacity between the NNO and HM buffer. The exoskarn xenoliths, in turn, formed at 510-910 °C under oxygen fugacity conditions between NNO and air. These high oxygen fugacities are likely imposed by the large volumes of CO2 liberated from the carbonate. Halogen and sulphur-rich mineral phases in the xenoliths testify to the infiltration by a magmatic brine. In some xenoliths this is associated with the precipitation of copper-bearing mineral phases by sulphur dissociation into sulphide and sulphate, indicating potential mineralisation in the skarn system below Merapi. Compositions of many xenolith clinopyroxene and plagioclase crystals overlap with that of magmatic minerals, suggesting that the crystal cargo in Merapi magmas may contain a larger proportion of skarn-derived xenocrysts than previously recognised. Assessment of xenolith formation timescales demonstrates that magma-carbonate interaction and associated CO2 release could affect eruption intensity, as recently suggested for Merapi and similar carbonate-hosted volcanoes elsewhere.