Increased protein intake by adults typically enhances reproduction and shortens life, but much less is known about the effects of protein intake prior to reproductive maturity. In particular, it remains unclear whether dietary protein mediates a trade-off between survival and the development of reproductive traits, especially in males. \We used the nutritional geometry approach to investigate the effects of 25 replicated larval diets varying in protein and carbohydrate content on larval performance and the development of adult male morphology in the neriid fly Telostylinus angusticollis. We found that body size increased with carbohydrate and especially protein content in the larval diet. Moreover, after controlling for body size, dietary protein strongly enhanced the expression of those male morphological traits that appear to be most directly targeted by sexual selection, while having no effect on the expression of other traits. In sharp contrast, egg-to-adult viability decreased steeply with increasing protein content. Thus, protein intake during the larval stage mediates a trade-off between the expression of male secondary sexual traits and the probability of survival to adult emergence.