Popular uprisings against authoritarian regimes are moments of crisis that pose a dilemma for the military. This study seeks to examine why the military defends the regime in some cases but defects and supports the opposition in others by examining how civil war dynamics influence the likelihood of military defection during popular uprisings. The study focuses on the effect government reliance of militia groups on the risk of defection. I argue that a higher degree of reliance on militias increases the risk of military defection in conflict-affected countries. This is because a higher degree of government reliance on militias results in the fragmentation of state security forces, which in turn alters the military's calculations when deciding whether to defend the regime or defect. Using structured, focused comparison, the study compares the Sudanese military’s response to popular uprisings in 2013 and 2019 and finds that a higher degree of government reliance on militias in 2019 is an important factor in explaining the military's decision to defect because of the increased fragmentation of security forces that compromised the military’s loyalty to the regime.