In the ocean, the chemical forms of nitrogen that are readily available for biological use (known collectively as 'fixed' nitrogen) fuel the global phytoplankton productivity that exports carbon to the deep ocean. Accordingly, variation in the oceanic fixed nitrogen reservoir has been proposed as a cause of glacial-interglacial changes in atmospheric carbon dioxide concentration. Marine nitrogen fixation, which produces most of the ocean's fixed nitrogen, is thought to be affected by multiple factors, including ocean temperature and the availability of iron and phosphorus. Here we reconstruct changes in North Atlantic nitrogen fixation over the past 160,000 years from the shell-bound nitrogen isotope ratio ((15)N/(14)N) of planktonic foraminifera in Caribbean Sea sediments. The observed changes cannot be explained by reconstructed changes in temperature, the supply of (iron-bearing) dust or water column denitrification. We identify a strong, roughly 23,000-year cycle in nitrogen fixation and suggest that it is a response to orbitally driven changes in equatorial Atlantic upwelling, which imports 'excess' phosphorus (phosphorus in stoichiometric excess of fixed nitrogen) into the tropical North Atlantic surface. In addition, we find that nitrogen fixation was reduced during glacial stages 6 and 4, when North Atlantic Deep Water had shoaled to become glacial North Atlantic intermediate water, which isolated the Atlantic thermocline from excess phosphorus-rich mid-depth waters that today enter from the Southern Ocean. Although modern studies have yielded diverse views of the controls on nitrogen fixation, our palaeobiogeochemical data suggest that excess phosphorus is the master variable in the North Atlantic Ocean and indicate that the variations in its supply over the most recent glacial cycle were dominated by the response of regional ocean circulation to the orbital cycles.