ABSTRACT: This secondary analysis explored the association between gestational weight gain, pre-pregnancy body mass index (BMI), and prenatal diet quality in a United States national sample. The sample comprised 1322 pregnant women in the longitudinal Infant Feeding Practices Study II with Diet History Questionnaire data. Diet quality in the third trimester was assessed using the Alternative Healthy Eating Index for Pregnancy. Self-reported pre-pregnancy BMI (categorized as underweight<18.5, normal weight 18.5-24.9, overweight 25.0-29.9, and obese≥30.0) and total gestational weight gain were used to categorize adherence to the Institute of Medicine's recommendations as inadequate, adequate, or excessive weight gain. Diet quality in pre-pregnancy BMI and gestational weight gain groups were compared using Tukey-adjusted generalized linear models adjusted for sociodemographic factors, Women, Infants, and Children participation, parity, and energy intake. Due to missing gestational weight gain data, sensitivity analyses with multiply imputed data were conducted. Women were on average 28.9 years old and of higher socioeconomic status (40% college graduates) and mostly non-Hispanic White (84%), and the mean Alternative Healthy Eating Index for Pregnancy score was 61.2 (of 130). Both pre-pregnancy BMI and gestational weight gain were inversely associated with diet quality scores (p<0.01). The interaction between pre-pregnancy BMI and gestational weight gain was significant (p = 0.04), therefore gestational weight gain models were stratified by BMI group. In stratified adjusted models, gestational weight gain was differently associated with diet quality scores (p<0.05) among women with underweight, normal weight, overweight, and obesity. The relationship between gestational weight gain and prenatal diet quality depended on pre-pregnancy BMI. For example, within women with normal weight, higher diet quality was observed in the adequate gestational weight gain group. Interventions to broadly improve prenatal diet quality are needed, however, resources can be used to target women with higher pre-pregnancy BMIs and women with inadequate or excessive gestational weight gain.