IntroductionBoth nitrogen (N) and magnesium (Mg) play important roles in biochemical and physiological processes in plants. However, the application of excessive N and insufficient Mg may be the factor leading to low nitrogen utilization rate (NUE) and fruit quality degradation in apple production.MethodsIn this study, we analyzed the effects of different application rates of Mg (0, 50, 100, 150, 200 kg/ha) on the photosynthetic nitrogen use efficiency (PNUE), the accumulation and distribution of carbon (C), N metabolism, anthocyanin biosynthesis and fruit quality of the ‘Red Fuji’ apple in 2018 and 2019.ResultsThe results showed that the application of Mg significantly increased the 15NUE and increased the allocation rate of 15N in the leaves whereas the 15N allocation rate in the perennial organs and fruits was decreased. With the increase in Mg supply, the activities of N metabolism enzymes (NiR, GS, and GOGAT) were significantly promoted and the content of intermediate products in N metabolism (NO2−, NH4+, and free amino acid) was significantly decreased. Furthermore, an appropriate rate of Mg significantly promoted the net photosynthetic rate (Pn) and photosynthetic nitrogen use efficiency (PNUE), enhanced the enzyme activities of C metabolism (SS, SPS, S6PDH), and increased the contents of sorbitol and sucrose in leaves. In addition, Mg upregulated the gene expression of sugar transporters (MdSOT1, MdSOT3, MdSUT1, and MdSUT4) in fruit stalk and fruit fresh; 13C isotope tracer technology also showed that Mg significantly increased the 13C allocation in the fruits. Mg also significantly increased the expression of anthocyanin biosynthesis genes (MdCHS and MdF3H) and transcription factors (MdMYB1 and MdbZIP44) and the content of anthocyanin in apple peel.ConclusionThe comprehensive analysis showed that the appropriate application of Mg (150 kg/ha) promoted PNUE, C–N metabolism, and anthocyanin biosynthesis in apple trees.