Abstract Background Undernutrition, which includes stunting, wasting, and underweight, is a global problem, especially among children of low- and middle-income countries. To our knowledge, this study is first of its type from Afghanistan. Its main objectives were to estimate the prevalence and associated risk factors of stunting, wasting/thinness, and underweight among urban primary school children in Kandahar city of Afghanistan. Methods This school-based cross-sectional study was conducted among 1205 primary school children aged 6–12 years during a period of six months (October 2022–March 2023). Anthropometric measurements and other data were collected from all the participants. Data were analyzed by using descriptive statistics, Chi square test (using crude odds ratio or COR), and multivariate logistic regression (using adjusted odds ratio or AOR). Results Among the 1205 enrolled government school students, 47.4%, 19.5%, and 25.6% had stunting, wasting/thinness, and underweight, respectively. Statistically significant factors associated with stunting were age group 6–9 years (AOR 1.3, 95% CI 1.1–1.7), being girl (AOR 2.3, 95% CI 1.8–3.0), poverty (AOR 2.2, 95% CI 1.5–3.2), large family (AOR 3.0, 95% CI 2.4–3.9), illiterate mother (AOR 1.6, 95% CI 1.0–2.6), jobless head of the family (AOR 3.3, 95% CI 2.3–4.8), and skipping breakfasts (AOR 1.7, 95% CI 1.2–2.3). Main factor associated with wasting/thinness were age group 6–9 years (AOR 30.5, 95% CI 11.8–78.7), skipping breakfasts (AOR 22.9, 95% CI 13.9–37.8), and history of sickness during the past two weeks (AOR 17.0, 95% CI 6.6–43.8). Also, main factors associated with underweight were age group 6–9 years (AOR 2.6, 95% CI 1.6–4.1), skipping breakfasts (AOR 2.6, 95% CI 1.8–3.6), and poor sanitation (AOR 1.9, 95% CI 1.1–3.2). Conclusions Stunting, wasting/thinness, and underweight are highly prevalent among primary school children (both girls and boys) in Kandahar city. It is recommended that local government (Afghanistan Ministry of Education and Ministry of Public Health) with the help of international organizations and donor agencies should implement comprehensive school-based feeding programs especially for girls. Health and nutrition education programs should be conducted with emphasis on nutrition of children aged 6–9 years as well as importance of healthy breakfast and good sanitation.