We report the discovery and analysis of a very strong magnetic field in the rapidly rotating early B-type star HR 5907, based on observations obtained as part of the Magnetism in Massive Stars (MiMeS) project. We infer a rotation period of 0.508 276+0.000 015−0.000 012 d from photometric and Hα EW measurements, making this the shortest period, non-degenerate, magnetic massive star known to date. From the comparison of IUE UV and optical spectroscopy with LTE bruce/kylie models we find a solid-angle integrated, uniform black-body temperature of 17 000 ± 1000 K, a projected rotational velocity of 290 ± 10 km s−1, an equatorial radius of 3.1 ± 0.2 R⊙, a stellar mass of 5.5 ± 0.5 M⊙, and an inclination angle of the rotation axis to our line-of-sight of 70 ± 10°. Our measurements of the longitudinal magnetic field, which vary between −500 and −2000 G, phase coherently with the rotation period and imply a surface dipole field strength of ∼15.7 kG. On the other hand, from fits to mean Least-Squares Deconvolved Stokes V line profiles we infer a dipole field strength of ∼10.4 kG. This disagreement may result from a magnetic configuration more complex than our model, and/or from the non-uniform helium surface abundance distribution. In either case we obtain a magnetic obliquity nearly aligned with the rotation axis (). Our optical spectroscopy also shows weak variability in carbon, silicon and nitrogen lines. The emission variability in hydrogen Balmer and Paschen lines indicates the presence of a dense, highly structured magnetosphere, interpreted as a centrifugally supported, magnetically confined circumstellar disc.