Macronutrient balance is an important determinant of fitness in many animals, including insects. Previous studies have shown that altering the concentrations of yeast and sugar in the semi-synthetic media has a profound impact on lifespan in Drosophila melanogaster, suggesting that dietary protein:carbohydrate (P:C) balance is the main driver of lifespan and ageing processes. However, since yeast is rich in multiple nutrients other than proteins, this lifespan-determining role of dietary P:C balance needs to be further substantiated through trials using a chemically-defined, synthetic diet. In the present study, the effects of dietary P:C balance on lifespan and fecundity were investigated in female D. melanogaster flies fed on one of eight isocaloric synthetic diets differing in P:C ratio (0:1, 1:16, 1:8, 1:4, 1:2, 1:1, 2:1 or 4:1). Lifespan and dietary P:C ratio were related in a convex manner, with lifespan increasing to a peak at the two intermediate P:C ratios (1:2 and 1:4) and falling at the imbalanced ratios (0:1 and 4:1). Ingesting nutritionally imbalanced diets not only caused an earlier onset of senescence but also accelerated the age-dependent increase in mortality. Egg production was suppressed when flies were fed on a protein-deficient food (0:1), but increased with increasing dietary P:C ratio. Long-lived flies at the intermediate P:C ratios (1:2 and 1:4) stored a greater amount of lipids than those short-lived ones at the two imbalanced ratios (0:1 and 4:1). These findings provide a strong support to the notion that adequate dietary P:C balance is crucial for extending lifespan in D. melanogaster and offer new insights into how dietary P:C balance affects lifespan and ageing through its impacts on body composition.