Population-based surveys in Southern Africa suggest a substantial burden of undiagnosed HIV-infected long-term survivors of mother-to-child transmission. We conducted an HIV prevalence survey of primary school pupils in Harare, Zimbabwe, and evaluated school-linked HIV counselling and testing (HCT) for pupils, their families and schoolteachers. Population-weighted cluster sampling was used to select six primary schools. Randomly selected class-grade pupils underwent anonymous HIV testing, with concurrent school-linked family HCT offered during the survey. Focus group discussions and interviews were conducted with pupils, parents/guardians, counsellors, and schoolteachers. About 4386 (73%) pupils provided specimens for anonymous HIV testing. Median age was 9 years (IQR 8-11), and 54% were female. HIV prevalence was 2.7% (95% CI: 2.2-3.1) with no difference by gender. HIV infection was significantly associated with orphanhood, stunting, wasting, and being one or more class grades behind in school due to illness (p<0.001). After adjusting for covariates, orphanhood and stunting remained significantly associated with being HIV positive (p<0.001). Uptake of diagnostic HIV testing by pupils was low with only 47/4386 (1%) pupils undergoing HCT. The HIV prevalence among children under 15 years who underwent HIV testing was 6.8%. The main barrier to HIV testing was parents' fear of their children experiencing stigma and of unmasking their own HIV status should the child test HIV positive. Most guardians believed that a child's HIV-positive result should not be disclosed and the child could take HIV treatment without knowing the reason. Increased recognition of the high burden of undiagnosed HIV infection in children is needed. Despite awareness of the benefits of HIV testing, HIV-related stigma still dominates parents/guardians' psychological landscape. There is need for comprehensive information and support for families to engage with HIV testing services.