['Although undernutrition is recognized as a risk factor for mortality among people living with HIV (PLWHIV), even among those initiating antiretroviral therapy, few studies have explored the underlying determinants of undernutrition. The objectives of the present study were to: (i) examine the independent association between household food security, individual diet quality and nutritional status; and (ii) determine if any association between food security and nutritional status is mediated through diet quality.', 'Cross-sectional baseline survey.', 'Gulu and Soroti districts, Uganda.', 'Nine hundred and two PLWHIV recruited into a study evaluating the impact of a food assistance programme supported by the World Food Programme.', 'Food security and diet quality were measured using the Household Food Insecurity Access Scale (HFIAS) and the Individual Dietary Diversity Score (IDDS), respectively. Multivariate regression results demonstrated that HFIAS and IDDS independently predict BMI (P < 0.01) and mid upper-arm circumference (P < 0.05). The adjusted odds ratio of being underweight (BMI < 18.5 kg/m2) among individuals living in severely food-insecure households was 1.92 (P < 0.0 0 1); individuals consuming a highly diverse diet had an adjusted odds ratio of being underweight of 0.56 (P < 0.05) compared with those consuming a diet of low diversity. Similar results were observed when mid upper-arm circumference and wasting were modelled as outcomes. Using path analysis, we observed that the indirect effect of food insecurity on BMI mediated through dietary diversity is negligible, and mostly a result of the direct effect of food insecurity on BMI.'] Do food access and diet quality independently predict nutritional status among people living with HIV in Uganda?