In the mammalian lung, an apparently homogenous mesh of capillary vessels surrounds each alveolus, forming the vast respiratory surface across which oxygen transfers to the blood1. Here we use single-cell analysis to elucidate the cell types, development, renewal and evolution of the alveolar capillary endothelium. We show that alveolar capillaries are mosaics; similar to the epithelium that lines the alveolus, the alveolar endothelium is made up of two intermingled cell types, with complex ‘Swiss-cheese’-like morphologies and distinct functions. The first cell type, which we term the ‘aerocyte’, is specialized for gas exchange and the trafficking of leukocytes, and is unique to the lung. The other cell type, termed gCap (‘general’ capillary), is specialized to regulate vasomotor tone, and functions as a stem/progenitor cell in capillary homeostasis and repair. The two cell types develop from bipotent progenitors, mature gradually and are affected differently in disease and during ageing. This cell-type specialization is conserved between mouse and human lungs but is not found in alligator or turtle lungs, suggesting it arose during the evolution of the mammalian lung. The discovery of cell type specialization in alveolar capillaries transforms our understanding of the structure, function, regulation and maintenance of the air–blood barrier and gas exchange in health, disease and evolution. Single-cell analysis of blood vessels in the alveolus, the site of chronic disease and virus-induced lung injury, reveals two intermingled endothelial cell types with specialized gas exchange and stem cell functions.