Novel magnetic carbon xerogels consisting of interconnected carbon microspheres with iron and/or cobalt microparticles embedded in their structure were developed by a simple route. As inferred from the characterization data, materials with distinctive properties may be directly obtained upon inclusion of iron and/or cobalt precursors during the sol-gel polymerization of resorcinol and formaldehyde, followed by thermal annealing. The unique properties of these magnetic carbon xerogels were explored in the catalytic wet peroxide oxidation (CWPO) of an antimicrobial agent typically found throughout the urban water cycle – sulfamethoxazole (SMX). A clear synergistic effect arises from the inclusion of cobalt and iron in carbon xerogels (CX/CoFe),the resulting magnetic material revealing a better performance in the CWPO of SMX at the ppb level(500 microg L−1) when compared to that of monometallic carbon xerogels containing only iron or cobalt.This effect was ascribed to the increased accessibility of highly active iron species promoted by the simultaneous incorporation of cobalt.The performance of the CWPO process in the presence of CX/CoFe was also evaluated in environmentally relevant water matrices, namely in drinking water and secondary treated wastewater, considered in addition to ultrapure water. It was found that the performance decreases when applied to more complex water and wastewater samples. Nevertheless, the ability of the CWPO technology for the elimination of SMX in secondary treated wastewater was unequivocally shown, with 96.8% of its initial content being removed after 6 h of reaction in the presence of CX/CoFe, at atmospheric pressure, room temperature(T = 25◦C), pH = 3, [H2O2]0= 500 mg L−1and catalyst load = 80 mg L−1. A similar performance (97.8% SMX removal) is obtained in 30 min when the reaction temperature is slightly increased up to 60◦C in an ultra-pure water matrix. Synthetic water containing humic acid, bicarbonate, sulphate or chloride, was also tested. The results suggest the scavenging effect of the different anions considered, as well as the negative impact of dissolved organic matter typically found in secondary treated wastewater, as simulated by the presence of humic acid.An in-situ magnetic separation procedure was applied for catalyst recovery and re-use during reusability cycles performed to mimic real-scale applications. CWPO runs performed with increased SMX concentration (10 mg L−1), under a water treatment process intensification approach, allowed to evalu-ate the mineralization levels obtained, the antimicrobial activity of the treated water, and to propose adegradation mechanism for the CWPO of SMX.