An extensive body of theory addresses the topic of pathogen virulence evolution, yet few studies have empirically demonstrated the presence of fitness trade-offs that would select for intermediate virulence. Here we show the presence of transmission-clearance trade-offs in dengue virus using viremia measurements. By fitting a within-host model to these data, we further find that the interaction between dengue and the host immune response can account for the observed trade-offs. Finally, we consider dengue virulence evolution when selection acts on the virus's production rate. By combining within-host model simulations with empirical findings on how host viral load affects human-to-mosquito transmission success, we show that the virus's transmission potential is maximized at production rates associated with intermediate virulence and that the optimal production rate critically depends on dengue's epidemiological context. These results indicate that long-term changes in dengue's global distribution impact the invasion and spread of virulent dengue virus genotypes.