A growing body of evidence links certain aspects of nonsteroidal anti-inflammatory drug (NSAID) pharmacology with acid-sensing ion channels (ASICs), a small family of excitatory neurotransmitter receptors implicated in pain and neuroinflammation. The molecular basis of NSAID inhibition of ASICs has remained unknown, hindering the exploration of this line of therapy. Here, we characterized the mechanism of inhibition, explored the molecular determinants of sensitivity, and sought to establish informative structure-activity relationships, using electrophysiology, site-directed mutagenesis, and voltage-clamp fluorometry. Our results show that ibuprofen is an allosteric inhibitor of ASIC1a, which binds to a crucial site in the agonist transduction pathway and causes conformational changes that oppose channel activation. Ibuprofen inhibits several ASIC subtypes, but certain ibuprofen derivatives show some selectivity for ASIC1a over ASIC2a and vice versa. These results thus define the NSAID/ASIC interaction and pave the way for small-molecule drug design targeting pain and inflammation.