In order to assess the significance of local adaptation relative to environmental plasticity on the evolution of life history traits, we analysed the possible genetic basis of differences between pond- and stream-breeding fire salamanders (Salamandra salamandra) in Germany. These salamanders typically deposit their larvae in small streams, where they grow until they are sufficiently large to metamorphose. However, some populations in Western Germany use ponds as larval habitat. Because habitat quality of streams differs from that of ponds one expects life history differences in the pond animals, which may result either from a plastic response or through genetic differentiation (i.e. local adaptation). Using a phylogeographical analysis of mitochondrial D-loop sequences, we show that both stream and pond populations in Western Germany are derived from a single lineage that recolonized following the last glaciation. This finding suggests that pond breeding originated very recently. Our studies of habitat quality and metamorphic behaviour of larvae in natural ponds and streams disclosed that pond larvae experience a significantly reduced food supply and greater risk of drying than do stream larvae. Pond larvae metamorphose earlier at the cost of reduced mass. Common-environment experiments with pond and stream larvae show that metamorphic behaviour of pond larvae under limited-food conditions is determined genetically and is not simply a plastic response to the differing habitat conditions. These results show that phenotypic plasticity is less important than local adaptation in explaining differences in ecological diversification within this species and suggests the possibility of rapid evolution of genetic adaptations when new habitats are exploited.