Olive flies (Bactrocera oleae) are intimately associated with bacteria throughout their life cycle, and both larvae and adults are morphologically adapted for housing bacteria in the digestive tract. We tested the hypothesis that these bacteria contribute to the adult fly's fitness in a diet-dependent fashion. We predicted that when dietary protein is superabundant, bacterial contribution will be minimal. Conversely, in the absence of protein, or when only non-essential amino acids are present (as in the fly's natural diet), we predicted that bacterial contribution to fitness will be significant. Accordingly, we manipulated diet and the presence of bacteria in female olive flies, and monitored fecundity-an indirect measure of fitness. Bacteria did not affect fecundity when females were fed a nutritionally poor diet of sucrose, or a proteinrich, nutritionally complete diet. However, when females were fed a diet containing non-essential amino acids as the sole source of amino nitrogen, egg production was significantly enhanced in the presence of bacteria. These results suggest that bacteria were able to compensate for the skewed amino acid composition of the diet and may be indispensable for wild adult olive flies that subsist mainly on nitrogen-poor resources such as honeydew.