A key stage in planet formation is the evolution of a gaseous and magnetized solar nebula. However, the intensity of the nebular field, the lifetime of the nebula, and the history of mass transport in the early solar system have been poorly constrained. Here we present analyses of the remanent magnetization in several meteorite groups demonstrating that an approximately Earth-strength (~50 μT) nebular magnetic field existed in the inner and outer solar system (~1-10 AU) during the first 1-3 My after solar system formation. The nebular field then declined to near-zero (<0.1 μT) in the ~1-10 AU region by ~4 My after solar system formation, suggesting that the solar nebula field, and likely the nebular gas, had globally dispersed by this time. This sets the timescale for formation of the gas giants and disk-driven planet migration and supports the hypothesis that giant planets form by a two-stage process involving formation of a rock-ice core followed by runaway gas accretion. Our magnetic measurements of volatile-rich carbonaceous meteorites and comet 67P Churyumov-Gerasimenko provide evidence for dynamical mixing of solids over tens of AU and indicate that we may have rock samples from the proto-Kuiper belt. Finally, our recent paleomagnetic studies of calcium-aluminum-rich inclusions (CAIs) have identified evidence for a >150 μT field, the oldest known paleomagnetic record. This provides evidence that disk magnetic fields a drove accretion of much of the Sun’s mass and possibly also thermal processing of the first solar system solids.