The scarcity of high-resolution empirical data directly tracking diversity over time limits our understanding of speciation and extinction dynamics and the drivers of rate changes. Here, we analyze a continuous species-level fossil record of endemic diatoms from ancient Lake Ohrid, along with environmental and climate indicator time series since lake formation 1.36 million years (Ma) ago. We show that speciation and extinction rates nearly simultaneously decreased in the environmentally dynamic phase after ecosystem formation and stabilized after deep-water conditions established in Lake Ohrid. As the lake deepens, we also see a switch in the macroevolutionary trade-off, resulting in a transition from a volatile assemblage of short-lived endemic species to a stable community of long-lived species. Our results emphasize the importance of the interplay between environmental/climate change, ecosystem stability, and environmental limits to diversity for diversification processes. The study also provides a new understanding of evolutionary dynamics in long-lived ecosystems.