Drosophila provides a useful model system for studies of the mechanisms involved in regulation of internal ion levels in response to variations in dietary salt load. This study assessed whether alterations in Na+ and K+ transport by the gut of larval D. melanogaster reared on salt-rich diets contribute to haemolymph ionoregulation. Na+ and K+ fluxes across the isolated guts of third instar larvae reared on control or salt-rich diets were measured using the scanning ion-selective electrode technique (SIET). K+ absorption across the anterior portion of the posterior midgut of larvae reared on diet in which the concentration of KCl was increased 0.4 mol l-1 above that in the control diet was reduced eightfold relative to the same gut segment of larvae reared on the control diet. There was also an increase in the magnitude and extent of K+ secretion across the posterior half of the posterior midgut. Na+ was absorbed across the ileum of larvae reared on the control diet, but was secreted across the ileum of larvae reared on diet in which the concentration of NaCl was increased 0.4 mol l-1 above that in the control diet. There was also a small reduction in the extent of Na+ absorption across the middle midgut of larvae reared on the NaCl-rich diet. The results indicate considerable phenotypic plasticity with respect to K+ and Na+ transport by the gut epithelia of larval D. melanogaster. SIET measurements of K+ and Na+ fluxes along the length of the gut show that ion transport mechanisms of the gut are reconfigured during salt stress so that there are reductions in K+ and Na+ absorption and increases in K+ and Na+ secretion. Together with previously described changes in salt secretion by the Malpighian tubules, these changes contribute to haemolymph ionoregulation.