Ammonia is a toxic nitrogenous waste product of amino acid metabolism that may accumulate to high levels in the medium ingested by larvae of the fruit fly, Drosophila melanogaster. Here we report measurements of haemolymph NH4+ concentration and the secretion of NH4+ by the Malpighian (renal) tubules. Measurement of NH4+ concentrations in secreted droplets is complicated either by the requirement for large sample volumes for enzymatic assays or by the inadequate selectivity of NH4+-selective microelectrodes based on nonactin. We have developed a novel liquid membrane NH4+-selective microelectrode based on a 19-membered crown compound (TD19C6), which has been used previously in ammonium-selective macroelectrodes. In conjunction with an improved technique for correcting for interference of potassium, NH4+-selective microelectrodes based on TD19C6 permit accurate measurement of ammonium concentration in haemolymph samples and nanoliter droplets of fluid secreted by the Malpighian tubules of Drosophila melanogaster. The results indicate that active secretion of ammonium into the Malpighian tubule lumen is sufficient to maintain concentrations of approximately 1 mmol l-1 ammonium in the haemolymph of larvae reared on diets containing 100 mmol l-1 ammonium chloride.