Oxygen minimum zones (OMZs) are natural physical features of the world's oceans. They create steep physiochemical gradients in the water column, which most notably include a dramatic draw down in oxygen concentrations over small vertical distances (<100 m). Microbial communities within OMZs play central roles in ocean and global biogeochemical cycles, yet we still lack a fundamental understanding of how microbial biodiversity is distributed across OMZs. Here, we used metagenomic sequencing to investigate microbial diversity across a vertical gradient in the water column during three seasons in the Eastern Tropical South Pacific (ETSP) OMZ. Based on analysis of small subunit ribosomal RNA (SSU rRNA) gene fragments, we found that both taxonomic and phylogenetic diversity declined steeply along the transition from oxygen-rich surface water to the permanent OMZ. We observed similar declines in the diversity of protein-coding gene categories, suggesting a decrease in functional (trait) diversity with depth. Metrics of functional and trait dispersion indicated that microbial communities are phylogenetically and functionally more overdispersed in oxic waters, but clustered within the OMZ. These dispersion patterns suggest that community assembly drivers (e.g., competition, environmental filtering) vary strikingly across the oxygen gradient. To understand the generality of our findings, we compared OMZ results to two marine depth gradients in subtropical oligotrophic sites and found that the oligotrophic sites did not display similar patterns, likely reflecting unique features found in the OMZ. Finally, we discuss how our results may relate to niche theory, diversity–energy relationships and stress gradients.