We investigated genetic differentiation and migration patterns in a small livebearing fish, Poecilia mexicana, inhabiting a sulfidic Mexican limestone cave (Cueva del Azufre). We examined fish from three different cave chambers, the sulfidic surface creek draining the cave (El Azufre) and a nearby surface creek without the toxic hydrogen sulphide (Arroyo Cristal). Using microsatellite analysis of 10 unlinked loci, we found pronounced genetic differentiation among the three major habitats: Arroyo Cristal, El Azufre and the cave. Genetic differentiation was also found within the cave between different pools. An estimation of first-generation migrants suggests that (i) migration is unidirectional, out of the cave, and (ii) migration among different cave chambers occurs to some extent. We investigated if the pattern of genetic differentiation is also reflected in a morphological trait, eye size. Relatively large eyes were found in surface habitats, small eyes in the anterior cave chambers, and the smallest eyes were detected in the innermost cave chamber (XIII). This pattern shows some congruence with a previously proposed morphocline in eye size. However, our data do not support the proposed mechanism for this morphocline, namely that it would be maintained by migration from both directions into the middle cave chambers. This would have led to an increased variance in eye size in the middle cave chambers, which we did not find. Restricted gene flow between the cave and the surface can be explained by local adaptations to extreme environmental conditions, namely H2S and absence of light. Within the cave system, habitat properties are patchy, and genetic differentiation between cave chambers despite migration could indicate local adaptation at an even smaller scale.