This dissertation sheds new light on the old question of whether outside threat induces ingroup cohesion. In three independent but interrelated empirical chapters, I explore the link between threat, conflict and cooperation from a temporal, macro-, and micro-level perspective.The first chapter looks at social mobilization before the outbreak of violence in Nigeria and in Africa more widely. By mapping the timing of survey interviews in relation to occurrences of violent communal conflict, the chapter demonstrates that in regions where the central state is weak, social mobilization predicts outbreaks of communal violence. Drawing on a variety of data sources, I demonstrate that the mobilization efforts we observe are indicative not of predatory intent but of efforts to prevent and prepare for the violence to come. The second chapter explores the larger pattern of ethnic diversity and cooperation in Africa, combining data from 33 African countries with continent-wide information on ethnic diversity. I find that, overall, ethnically diverse regions tend to have higher levels of cooperation. I explain this finding by disaggregating ethnic diversity into first-order ethnic diversity - the ethnic diversity of a community proper, theorized to undermine local cooperation - and second-order ethnic diversity - the ethnic diversity of the hinterland of a community, theorized to reinforce cooperation by inducing ethnic competition. I demonstrate that while first-order ethnic diversity is associated with lowered levels of cooperation, second-order diversity consistently goes along with higher levels of cooperation, especially in regions that have seen high levels of interethnic tensions. For the last chapter, I leave Africa and zoom in to a single region in Georgia, where exposure to ethnic outgroups varies on the micro-level. Using lab-in-the field methods I compare village-level variations in threat perceptions and cooperation. In order to measure threat perceptions behaviourally and without the confounding influence of a competitive setup, I introduce a new game, the threat game. Cooperation is measured with a standard public goods game. I find that levels of both ingroup cooperation and perceived threat are higher in regions more strongly exposed to ethnic outsiders, and that this effect is due to those feeling particularly threatened being spurred into investing in their ingroup rather than withdrawing their support from it. The introduction and conclusion serve to discuss overarching issues. I highlight the need for a comprehensive theory integrating threat, conflict and cooperation; explore the potential of variations in threat levels for explaining the distribution of cooperativeness across regions; and draw out the implications of the threat-cooperation nexus for contemporary multicultural societies.