Insects have long been known to excrete toxins via the Malpighian (renal) tubules. In addition, exposure to natural or synthetic toxins is commonly associated with increases in the activity of detoxification enzymes such as the P450 monoxygenases (P450s) and the glutathione-S-transferases (GSTs). We examined the links between mechanisms for detoxification and excretion in adult Drosophila melanogaster using functional assays and measurements of changes in gene expression by quantitative reverse transcriptase PCR in response to dietary exposure to compounds known to alter activity or gene expression of P450s and GSTs. Dietary exposure to phenol, which alters gene expression for multiple GSTs after seven to 10 generations, was also associated with an increase (more than twofold) in secretion of the organic anion methotrexate (MTX) by isolated tubules. Dietary exposure to the insecticide synergist piperonyl butoxide (PBO) was associated with reduced expression of two P450 genes (Cyp4e2, Cyp4p1) and two GST genes (GstD1, GstD5) in the tubules, as well as increased expression of Cyp12d1 and GstE1. Thin layer chromatographic analysis of fluid secreted by isolated tubules indicated that dietary exposure to PBO resulted in increased levels of an MTX metabolite. In addition, exposure to PBO altered the expression of transporter genes in the tubules, including a Drosophila multidrug resistance-associated protein, and was associated with a 73% increase in MTX secretion by isolated tubules. The results suggest that exposure of Drosophila to toxins evokes a coordinated response by the Malpighian tubules, involving both alterations in detoxification pathways as well as enhanced transport.