We develop a computational model to explore how ethnic geography shapes the distribution of violence in civil war. We seed the model with disaggregated data on ethnic settlement patterns in Afghanistan and calibrate the model parameters to fit empirically observed locations of violence against civilians. Our simulation suggests that (i) political actors are more likely to attack civilians in heterogeneous areas where members of one ethnic group are exposed to members of a rival group; (ii) violence directed at civilians occurs with greater frequency in locations where one political actor exercises hegemonic but incomplete territorial control (relative to areas of complete or mixed control); and (iii) geographically concentrated ethnic minorities face a higher risk of violence.