Divergent natural selection is thought to play a vital role in speciation, but clear, measurable examples from nature are still few. Among the many possible sources of divergent natural selection, predation pressure may be important because predators are ubiquitous in food webs. Here, we show evidence for divergent natural selection in a Lake Tanganyika cichlid, Telmatochromis temporalis, which uses burrows under stones or empty snail shells as shelters. This species contains normal and dwarf morphs at several localities. The normal morph inhabits rocky shorelines, whereas the dwarf morph invariably inhabits shell beds, where empty snail shells densely cover the lake bottom. Genetic evidence suggested that the dwarf morph evolved independently from the normal morph at two areas, and morphological analysis and evaluation of habitat structure revealed that the body sizes of morphs closely matched the available shelter sizes in their habitats. These findings suggest that the two morphs repeatedly evolved through divergent natural selection associated with the strategy for sheltering from predators.