High unprocessed and minimally processed food (UMP) intake has been associated with high-quality diets, while the opposite has been shown for ultra-processed food (UPF). Nevertheless, the association between UMP and UPF consumption and diet-quality over the long-term warrants further examination. This study aimed to assess whether UMP and UPF intake are associated with three diet-quality metrics in female and male health professionals from two US cohorts over three decades of follow-up. This is a cohort study, including data from the Nurses' Health Study (NHS), from 1986-2010 (n = 51,956) and the Health Professionals Follow-up Study (HPFS) from 1986-2006 (n = 31,307). /setting: Participants were invited in 1976 (NHS) and 1986 (HPFS) to respond to mailed questionnaires every 2-4 years and diet was assessed with a semi-quantitative food frequency questionnaire every 4 years. UMP and UPF intake were calculated using the NOVA classification. Generalized estimating equations for marginal means and repeated cross-sectional associations between diet-quality metrics and quintiles of UMP and UPF. Diets were assessed every four years from 1986 to 2010. With increasing quintiles of UMP intakes, the AHEI-2010 increased 7.1% (3.80 points [95%CI 3.66; 3.93]) in the NHS and 10.1% (5.75 points [95%CI 5.52; 5.98]) in the HPFS; the aMED increased 11.7% (0.50 points [95%CI 0.47; 0.52]) in the NHS and 14.0% (0.64 points [95%CI 0.60; 0.68]) in the HPFS; and the DASH-diet score increased 7.5% (1.81 points [95%CI 1.76; 1.87]) in the NHS and 10.6% (2.66 points [95%CI 2.57; 2.76]) in the HPFS. In the fifth quintile of UPF intake compared with the first, the AHEI-2010 was -9.3% (-4.60 points [95%CI -4.73; -4.47]) lower in the NHS and -13.7% (-6.89 points [95%CI -7.12; -6.66]) lower in the HPFS; the aMED was -14.7% (-0.55 points [95%CI -0.57; -0.53]) lower in the NHS and -19.0% (-0.74 points [95%CI -0.78; -0.70]) lower in the HPFS; and the DASH-diet score was -8.1% (-1.81 points [95%CI -1.86; -1.76]) lower in the NHS and -12.8% (-2.84 points [95%CI -2.93; -2.74]) lower in the HPFS. Consumption of UMP was associated with better dietary quality, while consumption of UPF was associated with poorer dietary quality.