Between 2010 and 2016, over 65,000 slum dwellers were forcibly evicted in Rio de Janeiro. This article compares three cases of anti-eviction resistance over this period. While the three case study communities were all relatively successful in contesting evictions, the outcomes (material, social, political-symbolic) of their mobilizations were different. To understand how and why, we examine and compare the structures and processes of mobilization in these three communities and show how they found different openings and limitations in the changing political opportunity structure. We distinguish three distinct ‘moments’ or opportunity structures in Rio de Janeiro’s urban governance between 2010 and 2016. We term these the City of Exception, the City in Revolt and the City in Crisis. The analytical and theoretical framework of contentious politics helps us draw together and expand on two dominant narratives in scholars’ approach to slum evictions: on the one hand a top-down perspective of the ‘city against slum dwellers’; on the other a bottom-up perspective of ‘slum dwellers against the city’. In this article we test the usefulness of our expanded framework—contentious politics of slums—for understanding the organization and outcomes of community resistance against evictions, and discuss its relevance for research on the politics of slums in the global South.