We observed NGC 1624-2, the O-type star with the largest known magnetic field (B p ∼ 20 kG), in X-rays with the ACIS-S camera onboard the Chandra X-ray Observatory. Our two observations were obtained at the minimum and maximum of the periodic Hα emission cycle, corresponding to the rotational phases where the magnetic field is the closest to equator-on and pole-on, respectively. With these observations, we aim to characterise the star's magnetosphere via the X-ray emission produced by magnetically confined wind shocks. Our main findings are: (i) The observed spectrum of NGC 1624-2 is hard, similar to the magnetic O-type star θ 1 Ori C, with only a few photons detected below 0.8 keV. The emergent X-ray flux is 30% lower at the Hα minimum phase. (ii) Our modelling indicated that this seemingly hard spectrum is in fact a consequence of relatively soft intrinsic emission, similar to other magnetic Of?p stars, combined with a large amount of local absorption (∼1-3×10 22 cm −2 ). This combination is necessary to reproduce both the prominent Mg and Si spectral features, and the lack of flux at low energies. NGC 1624-2 is intrinsically luminous in X-rays (log L em X ∼33.4) but 70-95% of the X-ray emission produced by magnetically confined wind shocks is absorbed before it escapes the magnetosphere (log L ISMcor X ∼32.5). (iii) The high X-ray luminosity, its variation with stellar rotation, and its large attenuation are all consistent with a large dynamical magnetosphere with magnetically confined wind shocks.