Background: The level of viral diversity in an HIV-infected individual can change during the course of HIV infection, reflecting mutagenesis during viral replication and selection of viral variants by immune and other selective pressures. Differences in the level of viral diversity in HIV-infected infants may reflect differences in viral dynamics, immune responses, or other factors that may also influence HIV disease progression. We used a novel high resolution melting (HRM) assay to measure HIV diversity in Ugandan infants and examined the relationship between diversity and survival through 5 years of age. Methods: Plasma samples were obtained from 31 HIV-infected infants (HIVNET 012 trial). The HRM assay was used to measure diversity in two regions in the gag gene (Gag1 and Gag2) and one region in the pol gene (Pol). Results: HRM scores in all three regions increased with age from 6-8 weeks to 12-18 months (for Gag1: P = 0.005; for Gag2: P = 0.006; for Pol: P = 0.016). Higher HRM scores at 6-8 weeks of age (scores above the 75th percentile) were associated with an increased risk of death by 5 years of age (for Pol: P = 0.005; for Gag1/Gag2 (mean of two scores): P = 0.003; for Gag1/Gag2/Pol (mean of three scores): P = 0.002). We did not find an association between HRM scores and other clinical and laboratory variables. Conclusions: Genetic diversity in HIV gag and pol measured using the HRM assay was typically low near birth and increased over time. Higher HIV diversity in these regions at 6-8 weeks of age was associated with a significantly increased risk of death by 5 years of age.