Violence victimization is a risk factor for adolescent pregnancy in high-income, low violence prevalence countries, but longitudinal data are lacking from settings where violence and adolescent pregnancy are common, including sub-Saharan Africa. We also know little about contextual factors which modify this association. We analyzed data from the Contexts of Violence in Adolescence Cohort (CoVAC) study in Luwero District, Uganda. Primary students in 42 schools completed surveys in 2014 (Wave 1) and 2018 (Wave 2). Our outcome was unplanned pregnancy. Our exposure was violence victimization, including any violence, type of violence (physical, emotional, sexual), perpetrator group (teacher, peer, family member), and polyvictimization. We fit mixed-effects logistic regression models and examined school factors (e.g., connectedness, absenteeism) as effect modifiers, using data from students (n = 3,431) and staff (n = 591) at the 42 schools. 1,449 girls were included in analyses (78% follow-up). At Wave 1, 88% (n = 1,281/1,449) reported any violence (mean age = 12.73, SD = 1.44 years). At Wave 2, 13.9% (n = 201/1,449) reported an unplanned pregnancy. In adjusted models, compared to no violence, significant associations (p<0.05) were observed for any violence (OR = 1.99, 95%CI = 1.03-3.85), physical violence (OR = 1.96, 95%CI = 1.02-3.79), teacher violence (OR = 1.96, 95%CI = 1.01-3.79), peer violence (OR = 2.00, 95%CI = 1.00-4.03), family violence (OR = 2.23, 95%CI = 1.07-4.65), violence from one perpetrator group (OR = 2.04, 95%CI = 1.01-4.15), and violence from three perpetrator groups (OR = 2.21, 95%CI = 0.99-4.95). Sexual and emotional violence were associated in crude but not adjusted analyses. School and peer connectedness modified the association (p<0.05); girls who experienced violence had higher odds of unplanned pregnancy in schools with lower versus higher connectedness. Violence victimization in early adolescence is strongly associated with subsequent unplanned pregnancy among adolescent girls in Uganda but attending schools with more school or peer connectedness attenuated this link. Interventions should seek to reduce violence against girls to prevent unplanned pregnancy. Interventions promoting positive connections to school may be especially important for violence victims.