This paper presents an economic theory of squatter settlements in developing countries. It adds to the existing literature by explicitly modeling squatting on government-owned land and presents a unified framework for analysis of issues related to squatting, urban planning and policy. In the model, a squatter-organizer optimally controls squatting so as to forestall eviction. The model highlights how the existence of an eviction cost leads to formal residents tolerating squatting, trading-off “open space” to avoid paying taxes toward evicting squatters. The paper derives comparative-static results under some functional form assumptions. The analysis is extended to examine the comparative-static effects for the case where squatters freely migrate into the city. The framework for exploring a combined model of squatting on government and private land is also laid out. Finally, some policy analysis of squatter formalization is carried out.