Duplicated genes are important in the evolution and ecology of plant-defences because herbivore and pathogen attack can be countered via functional diversification at two levels: among duplicated loci and within loci. We explore molecular sequence variation for two members of a defence-related gene family, Arabidopsis thaliana trypsin inhibitors (ATTI), in A. thaliana and a closely related species, A. lyrata subspp. petraea. A worldwide sample of the inbreeding annual A. thaliana had less genetic variation at two ATTI loci (piTOTAL <or= 0.0006) than observed previously at other functional loci. A significant excess of high frequency derived alleles in the signal sequence and 5' UTR of ATTI2 was consistent with a model of positive selection. However, demographic processes such as population subdivision and expansion, both likely to have occurred in A. thaliana during the last 10 000 years, can also give rise to similar deviations from neutrality. A single population of A. lyrata subspp. petraea in Germany had up to an order of magnitude more standing genetic variation at ATTI loci than the species-wide sample of A. thaliana. Although the level of variability for ATTI1 and ATTI2 within this single population was similar to, or even greater than, observed species-wide diversity for other loci in A. lyrata, there was little evidence to reject an equilibrium neutral model. A spatially explicit sample of 87 A. lyrata subspp. petraea individuals detected outbreeding (FIS = -0.16; FIT = -0.15) but little population subdivision (FST = 0.006) in this self-incompatible perennial herb. Genetic differences between Arabidopsis species were consistent with, but not fully explained by, divergence in ecology and life history. Diversification appears to have occurred in different functional domains for the tandemly duplicated ATTI1 and ATTI2 genes; the majority of fixed replacements in ATTI1 surround the enzyme binding site of the mature protein, whereas in ATTI2 most functional evolutionary change is located in the signal peptide. This pattern is consistent with a hypothesis of subfunctionalization in trypsin inhibitory function.