Background. Children living with HIV (CLWH) are at high risk of colonization and infection by bacterial respiratory pathogens. Microbes in the upper respiratory microbiome can prevent colonization by these pathogens. The impact of HIV infection on development of the upper respiratory microbiome during childhood is poorly understood. Methods. We enrolled healthy CLWH (<5 years) and age- and sex-matched HIV-exposed, uninfected (HEU) and HIV-unexposed, uninfected (HUU) children in a cross-sectional study conducted in Botswana. We used shotgun metagenomic sequencing to compare the nasopharyngeal microbiomes of children by HIV status. Findings. Of 143 children, 44 were CLWH, 49 were HEU, and 50 were HUU. Nasopharyngeal microbiome composition differed by HIV status (p=0.043, R2=0.019). The relative abundance of Corynebacterium pseudodiphtheriticum was lower in CLWH compared to HEU and HUU children (p=0.01). Among CLWH, a low (<25%) CD4+ cell percentage was associated with microbiome composition (p=0.009, R2=0.042) and lower relative abundances of Corynebacterium propinquum (p=0.003), C. pseudodiphtheriticum (p=0.007), and Dolosigranulum pigrum (p=0.004). The relative abundances of C. propinquum, C. pseudodiphtheriticum and D. pigrum in the nasopharyngeal microbiome were negatively correlated with the abundances of Streptococcus pneumoniae and Staphylococcus aureus. Interpretation. CLWH with HIV-associated immunosuppression have altered nasopharyngeal microbiome composition and lower abundances of bacterial species associated with respiratory health during childhood. These findings suggest that the upper respiratory microbiome may contribute to the high risk of bacterial respiratory infections among CLWH. Funding. National Institutes of Health, Duke Center for AIDS Research, Penn Center for AIDS Research.