Strategies of repression vary widely between extrajudicial and judicial extremes, from unrestrained acts of violence to highly routinized legal procedures. While the former have received a great deal of scholarly attention, judicial methods remain relatively understudied. When and why do rulers repress their rivals in court? The author argues that autocrats use a judicial strategy of repression when confronting challengers from within the ruling elite. Unlike regime outsiders, who pose a common, external threat to mobilize against, insiders present a more divisive target. When autocrats confront the latter, a judicial strategy legitimizes punishment, deters future rivals, and generates shared beliefs regarding incumbent strength and challenger weakness. Using original data on political prisoners in postcolonial sub-Saharan Africa, the author finds that autocrats were significantly more likely to use a judicial strategy against insiders and an extrajudicial strategy against outsiders. A case study of Kenya traces the logic of the theory, showing how intraregime conflict made courts a valuable instrument of state repression. The findings demonstrate how courts can play a central role in autocratic survival.