Nest construction is more diverse in the Hirundinidae than in any other family of oscine birds. To explore the evolution of this diversity, we superimposed nest data on a DNA-hybridization phylogeny of 17 swallow species. Nest construction is tightly linked to the inferred evolutionary history. Burrowing appears to be the primitive nesting mode, and burrowing ancestors gave rise to cavity-adopting and mud-nesting clades. Obligate cavity adoption is mostly confined to a monophyletic clade in the New World, and the diversification of obligate nest adopters appears to be tied to the richness of forest habitats and recent active mountain building there. Construction of mud nests originated only once in the history of the group, and mud-nesters have diversified principally in Africa, where a drier climatic history has favored their mode of nesting. The use of pure mud to construct a hanging nest is unique among all birds, and we infer that mud nests have increased in complexity during evolution from simple mud cups to fully enclosed retort-shaped nests. This increased complexity appears to have been the critical precursor for the evolution of high-density colonial mud-nesters.