Among the formalisms for qualitative spatial reasoning, the Region Connection Calculus and its variant, the constraint algebra RCC8, have received particular attention recently. A translation of RCC8 constraints into a multimodal logic has been proposed by Bennett, but in his work a thorough semantical foundation of RCC8 and of the translation into modal logic is missing. In the present paper, we give for the rst time a rigorous foundation for reasoning in RCC8. To represent qualitative relationships between regions, we introduce a language of topological set constraints, which generalizes RCC8. We formulate a semantics for our language that interprets regions as subsets of topological spaces. Using McKinsey and Tarski's topological interpretation of the modal propositional logic S4, we reduce reasoning about topological constraints to reasoning in that logic. We show that reasoning in the general language is PSPACE-complete. As a special case, we obtain also a reduction of const...