We present a new model of the magnetic field at the core–mantle boundary for the interval 1590–1990. The model, called gufm1, is based on a massive new compilation of historical observations of the magnetic field. The greater part of the new dataset originates from unpublished observations taken by mariners engaged in merchant and naval shipping. Considerable attention is given to both correction of data for possible mislocation (originating from poor knowledge of longitude) and to proper allocation of error in the data. We adopt a stochastic model for uncorrected positional errors that properly accounts for the nature of the noise process based on a Brownian motion model. The variability of navigational errors as a function of the duration of the voyages that we have analysed is consistent with this model. For the period before 1800, more than 83 000 individual observations of magnetic declination were recorded at more than 64 000 locations; more than 8000 new observations are for the 17th century alone. The time–dependent field model that we construct from the dataset is parametrized spatially in terms of spherical harmonics and temporally in B–splines, using a total of 36 512 parameters. The model has improved the resolution of the core field, and represents the longest continuous model of the field available. However, full exploitation of the database may demand a new modelling methodology.