ContextNortheast China is the main commodity grain base in China owing to its intensive corn (Zea mays L.) planting and heavy nitrogen (N) application. Alfalfa (Medicago sativa L.) and corn rotation have the potential to decrease N application and enable efficient N utilization, but its long-term impacts remain unclear. ObjectiveThis study utilized Agricultural Production Systems sIMulator (APSIM) to evaluate the N process of long-term alfalfa–corn rotation, including the soil N status and N legacy benefits of subsequent corn crops, and to optimize alfalfa–corn rotation. MethodsAPSIM was calibrated and validated utilizing datasets of crop N uptake (Nupt), soil inorganic N, and soil total nitrogen (TN) under continuous corn, continuous alfalfa, and rotations of three, four, and five years of alfalfa followed by two years of corn, defined as CC, CA, and 3A2C, 4A2C, and 5A2C treatments, respectively, which were collected from a field experiment in Quanyangou–Lishu, Jilin Province, China during 2014–2022. The validated APSIM was then utilized to simulate long-term (1981–2020) effects on N utilization under CC, 3A2C, 4A2C, and 5A2C treatments at Quanyangou–Lishu, Fujia–Lishu, Chaoyang, and Hailun in Northeast China. ResultsAPSIM effectively simulated the Nupt, inorganic N, and TN, with normalized root mean square errors of 5%–19%, 20%–30%, and 2.0%–4.2%, respectively, between the observed and simulated values. Compared with the CC treatment, alfalfa–corn rotation treatments reduced the N fertilizer application by 143 kg N ha−1 and significantly improved the net N mineralization and Nupt by 41 and 107 kg N ha−1, respectively, achieving increases of 50% and 517% in N use efficiency and N partial factor productivity based on corn equivalent yield, respectively. Alfalfa–corn rotation also consumed 94% of 200–500 cm inorganic N through alfalfa roots absorbing N after 9–14 years, which decreased the risk of soil inorganic N accumulation and N leaching. After 40 years, SON values of alfalfa–corn rotation treatments were 8% and 4% higher in the 0–20 and 20–60 cm soil layers and 1.6% lower in the 60–200 cm soil layer than those of the CC treatment at Quanyangou–Lishu, Fujia–Lishu and Hailun. The SON values of alfalfa–corn rotation treatments were 2.9% lower in three soil layers at 0–200 cm deep relative to those of the CC treatment at Chaoyang, with low precipitation of only 478 mm. Alfalfa–corn rotation also improved the first-year corn yield following alfalfa by 2.3%–8.8% at Quanyangou–Lishu and Fujia–Lishu. ConclusionsThe 4A2C treatment at Quanyangou–Lishu, Fujia–Lishu, and Hailun and the 3A2C treatment at Chaoyang are recommended in Northeast China to increase N use efficiency and N partial factor productivity by decreasing N fertilizer application, increasing SON, and absorbing inorganic N from the 200–500 cm soil layer during the alfalfa growing period and increasing mineral N during the corn growing period. ImplicationsOptimal alfalfa–corn rotations show great potential to reduce soil inorganic N residue and increase N use efficiency and SON in Northeast China.