On nociceptive neurons the commonest response to ATP is a rapidly desensitizing current mediated by P2X(3) receptors and believed to be involved in certain forms of pain. P2X(3) receptor recovery from desensitization is a slow process. We studied whether Mg(2+) might modulate such ATP-evoked currents on rat cultured DRG neurons, and thus account for its analgesic action in vivo. Transient increases in extracellular Mg(2+) strongly and reversibly depressed ATP currents which had not recovered from desensitization. Ca(2+)-free solution had the same action as Mg(2+). High Mg(2+) or Ca(2+)-free modulation depended on exposure length to modified divalent cation solutions, whereas it was independent from membrane potential or intracellular Ca(2+) buffering. Paired-pulse protocols showed that high Mg(2+) or Ca(2+)-free medium delayed ATP receptor recovery from desensitization, while leaving desensitization onset apparently unchanged. Tests with various concentrations of Ca(2+) and Mg(2+) showed that the depressant action by Mg(2+) was primarily due to functional antagonism of a facilitatory effect of Ca(2+) on ATP receptor function. The present results suggest that, on sensory neurons, P2X(3) receptors could be inhibited by high Mg(2+) or lack of Ca(2+), representing a negative feedback process to limit ATP-mediated nociception.