Linkage disequilibrium (LD) reflects coinheritance of an ancestral segment by chromosomes in a population. To begin to understand the effects of population history on the extent of LD, we model the length of a tract of identity-by-descent (IBD) between two chromosomes in a finite, random mating population. The variance of an IBD tract is large: a model described by (Genet. Res. Cambridge 35 (1980) 131) underestimates this variance. Using Fisher's concept of junctions, we predict the mean length of an IBD tract, given the age of the population and the population sizes over time. We derive results also for subdivided populations, given times of subdivision events and sizes of the resulting subpopulations. The model demonstrates that population growth and subdivision strongly affect the expected length of an IBD tract in small populations. These effects are less dramatic in large populations.