Abstract We present the first model aimed at understanding how the Meissner effect in a young neutron star affects its macroscopic magnetic field. In this model, field expulsion occurs on a dynamical timescale, and is realised through two processes that occur at the onset of superconductivity: fluid motions causing the dragging of field lines, followed by magnetic reconnection. Focussing on magnetic fields weaker than the superconducting critical field, we show that complete Meissner expulsion is but one of four possible generic scenarios for the magnetic-field geometry, and can never expel magnetic flux from the centre of the star. Reconnection causes the release of up to ∼5 × 1046 erg of energy at the onset of superconductivity, and is only possible for certain favourable early-phase dynamics and for pre-condensation fields 1012 G ≲ B ≲ 5 × 1014 G. Fields weaker or stronger than this are predicted to thread the whole star.