The steroid hormone testosterone regulates aggressive behaviour in many vertebrates and is important for territorial defence among males of the same species. However, its role in mediating interspecific competition, and ultimately species distributions, is unknown. We show that testosterone may influence the geographical replacement of one species by another. Townsend's warblers (Dendroica townsendi) have replaced hermit warblers (D. occidentalis) over a vast portion of their historical range, partly because Townsend's males are more aggressive than hermit males and outcompete them for territories in areas of sympatry. We report differences in plasma androgen levels that parallel these aggressive asymmetries and the historical pattern of species replacement between Townsend's and hermits. Using hybrids, we provide evidence that these hormonal differences are partially genetically based and thus may have evolved through sexual selection during Pleistocene glacial maxima. Hormone–behaviour mechanisms can therefore have important effects on species distributions and can even influence the pathways underlying extinction.