Given the abundance of evidence that United Nations (UN) peacekeepingoperations (PKOs) promote peace in conflict settings, we know remarkably little about what explains violence against peacekeepers themselves. We argue that armed groups target PKOs in response to peacekeepers’ interactions with civilians away from the battlefield. Contemporary PKOs function as surrogates for the state, providing civilians with governance and security in areas of limited statehood. Armed groups competing with the government for control over the local population thus target peacekeepers where their ability to gain civilian support is the greatest. Using cross-national data on attacks against UN peacekeepers deployed to Africa from 1999-2019, we find a robust relationship between the deployment of additional UN policing patrols and the targeting of peacekeepers. This pattern holds even when we account for possible selection bias that may arise from the deployment of police into certain areas. We investigate the causal mechanisms underlying this relationship with an in-depth statistical and qualitative case study of peacekeeper targeting in Mali, a critical case for understanding this type of violence. Our analysis reveals that armed groups attack UN PKOs in areas with frequent UN police patrols because UN police succeed in integrating themselves within the civilian population, gather information on the location of armed groups, and frustrate rebel governance.