We report magnetic and spectroscopic observations and modelling of the Of?p star HD 148937 within the context of the Magnetism in Massive Stars (MiMeS) Large Program at the Canada–France–Hawaii Telescope. 32 high signal-to-noise ratio circularly polarized (Stokes V) spectra and 13 unpolarized (Stokes I) spectra of HD 148937 were acquired in 2009 and 2010. A definite detection of a Stokes V Zeeman signature is obtained in the grand mean of all observations [in both least-squares deconvolved (LSD) mean profiles and individual spectral lines]. The longitudinal magnetic field inferred from the Stokes V LSD profiles is consistently negative, in contrast to the essentially zero field strength measured from the diagnostic null profiles. A period search of new and archival equivalent width measurements confirms the previously reported 7.03 d variability period. The variation of equivalent widths is not strictly periodic: we present evidence for evolution of the amount or distribution of circumstellar plasma. Interpreting the 7.03 d period as the stellar rotational period within the context of the oblique rotator paradigm, we have phased the equivalent widths and longitudinal field measurements. The longitudinal field measurements show a weak sinusoidal variation of constant sign, with extrema out of phase with the Hα variation by about 0.25 cycles. From our constraint on v sin i≤ 45 km s−1, we infer that the rotational axis inclination i≤ 30°. Modelling the longitudinal field phase variation directly, we obtain the magnetic obliquity β= 38+17−28° and dipole polar intensity Bd= 1020−380+310 G. Simple modelling of the Hα equivalent width variation supports the derived geometry. The inferred magnetic configuration confirms the suggestion of Nazé et al., who proposed that the weaker variability of HD 148937 as compared to other members of this class is a consequence of the stellar geometry. Based on the derived magnetic properties and published wind characteristics, we find a wind magnetic confinement parameter η*≃ 20 and rotation parameter W= 0.12, supporting a picture in which the Hα emission and other line variability have their origin in an oblique, rigidly rotating magnetospheric structure resulting from a magnetically channelled wind.