The current study aimed to synthesize a cadmium oxide/calcium ferrite nanocomposite (CdO/CaFe2O4–NC) by sol–gel auto-combustion method, then applied on the surface of a glassy carbon electrode to fabricate a (CdO/CaFe2O4–NC/GCE) as a sensor for the electrochemical detection of metronidazole (MNZ). The characterization of synthesized CaFe2O4-NPs and CdO/CaFe2O4–NC was carried out through various analytical techniques, to confirm surface morphology, crystallite nature, average particle size, magnetic behavior, and stability. It is an effective electrochemical method for the detection of MNZ. The fabricated electrode was characterized by cyclic voltammetry, indicating its diffusion-controlled electron transfer behavior. Thus, CdO/CaFe2O4–NC/GCE was used to quantify MNZ using differential pulse voltammetry with a dynamic range of 0.05–130 µM (R2 = 0.0996) and LOD of 0.034 µM. The electrochemical method showed significant stability, sensitivity, and reproducibility (RSD < 4.00 %). The fabricated sensor was successfully applied to the contaminated water samples with quantitative recoveries up to 93.02 % by the spiking method.