This paper traces the development and diversification of the squatter housing form - favela - and the music form - samba - in Rio de Janeiro from the late 19th century to the present. It is posited that in reflecting (working class) endogenous attitudes and (middle class) exogenous social mores, these two forms have shared a parallel if not precisely time-phased evolution. Evidence is presented to show that poverty, black identity and spatial exclusion from wider society were essential contributors to the origins of the favelas in the late 19th century and the samba in the early 20th century. During the 1940s and 50s when public attitudes to the favelas and their inhabitants were strongly negative, with many favelas being eradicated under public housing policy, protest themes and songs against poverty and marginalisation in samba were suppressed by the Rio authorities. In more recent times, with official attitudes towards the favelas improving and the favelas diversifying in socio-economic and cultural terms, the samba has begun to incorporate other music forms and to widen its cultural basis. Just as attempts are now being made by the city hall to integrate the favelas with the formal city, the samba, assisted by Carnival, has become accepted as a form of mass culture, enjoyed not only by the city of Rio but also by Brazil and the world at large. The close, if not parallel, development of the Rio favelas and samba, encourages a consideration that samba can be seen as a metaphor for the favelas themselves.