Armed conflicts frequently fuel tensions between groups. The “cognitive perspective” of group identification offers a possible explanation, but is tacit on exact causal pathways. We predict that indiscriminate violence by armed actors induces fear of future attacks which in turn leads to prejudice, enhanced in-group cohesion, and calls for segregation. Selective violence does not have these effects. Relying on panel surveys conducted in Nairobi and Mombasa during the violent Kenyan elections in the Summer of 2017, we find evidence for the predicted effects among Christians in 2-way Fixed Effects estimation and an endorsement experiment.