The density and dispersion of individuals, nonequilibrium demographics, and habitat fragmentation all affect the magnitude and extent of spatial genetic structure within forest tree populations. Here, we investigate the link between historical demography and spatial genetic structure within ecologically contrasting stands of foxtail pine (Pinus balfouriana) in the Klamath Mountains of northern California. We defined two stand types a priori, based largely on differences in foxtail pine density and basal area, and for each type we sampled two stands. Population expansions, likely from Pleistocene bottlenecks, were detected in three of the four stands. The magnitude and extent of spatial autocorrelation among genotypes at five nuclear microsatellites differed dramatically among stands, with those having lower foxtail pine density exhibiting strong patterns of isolation by distance. Moran's I statistics were 7-fold higher for the first distance class (<25 m) in these stands relative to those observed in stands with higher foxtail pine density (I(25) = 0.14 vs. 0.02). We conclude that differences in spatial genetic structure between stand types are due to differences in ecological attributes that affected expansion from inferred bottlenecks.