A celebrated theorem of Marshall Hall Jr. implies that finitely generated free groups are subgroup separable and that all of their finitely generated subgroups are retracts of finite-index subgroups. We use topological techniques inspired by the work of Stallings to prove that all limit groups share these two properties. This answers a question of Sela.Limit groups are finitely presented groups that arise naturally in many different aspects of the study of finitely generated (non-abelian) free groups. Perhaps their most satisfying characterization is as the closure of the set of free groups in the topology on marked groups that arose from the work of M. Gromov and R. Grigorchuk (see [4]). Limit groups admit a hierarchical decomposition in which the basic building blocks are free groups, free abelian groups and the fundamental groups of surfaces of Euler characteristic less than -1. Therefore, it seems natural to try to generalize properties of these ubiquitous classes of groups to limit groups.Much of the recent work on limit groups has been motivated by the fundamental role that they play in the study of Hom(G, F), the variety of homomorphisms from a finitely generated group G to a free group F, and in the first-order logic of the free group. One can associate to a group G the elementary theory of G, the set of sentences in first-order logic that hold in G. The elementary theory contains the existential theory, which consists of those sentences that use only one, existential, quantifier. From this point of * Partially supported by an EPSRC student scholarship and by a post-doctoral fellowship at the Hebrew University of Jerusalem, Israel.