Despite being relatively neglected until the early 2000s, seagrass ecosystems are now recognized as critical habitats supporting biodiversity and ecosystem services including carbon sequestration, coastal protection and food supply. In this Review, we discuss the structure and function of seagrass beds, the ways that they support biodiversity and ecosystem services, their dominant threats, and the most promising conservation and restoration opportunities. Seagrass ecosystems support biologically diverse communities, and food web integrity within these communities can reciprocally maintain healthy seagrass ecosystems. Numerous anthropogenic pressures caused persistent declines of 1% to 2% per year in global extent during the twentieth century, but a range of policies, primarily focused on reducing coastal water pollution, have attenuated or reversed losses in some regions. Uncertainty about the global and regional distributions of seagrasses and their trajectories, as well as the high costs of restoration, undermine conservation progress. An escalation in research effort is required to improve projections of seagrass responses to climate change and to identify cost-effective and scalable restoration approaches.