How does the withdrawal of United Nations peacekeeping operations (PKOs) influence local-level violence during election times? Many large PKOs recently ended and peacekeeping personnel numbers are decreasing. Yet, research on peacekeepers’ exit remains in its infancy. We help fill this lacuna and examine how peacekeepers’ withdrawal from subnational locations affects violence during electoral periods, which are both popular intervention endpoints and violence-prone moments in post-war trajectories. We argue that electoral periods incur more violence shortly after the withdrawal of PKO troops because domestic forces require time to adapt and fill security gaps. Moreover, withdrawal entails an abrupt shortfall of election assistance, opening opportunities for fraud that often triggers violence. In the medium-term, however, violence in previous deployment locations may subside because of the peace-conducive imprints of peacekeepers’ activities on institutions, security forces, and citizens. We test our argument across first order administrative units of all African countries hosting a PKO in the period 2001-2017. Controlling for trends in violence prior to peacekeepers’ exit, our two-way fixed effects models suggest that a local reduction in the number of PKO troops during electoral periods is indeed associated with a spike in violence. While the level of violence after the month of withdrawal decreases again, elections in locations that previously hosted troops are not generally more peaceful than elections in locations that never hosted troops. Taken together, peacekeepers’ phased exit generates local insecurity and their medium-run protection legacies during electoral periods are weak at best.