Cortical spreading depression (CSD) is closely associated with important pathologies including stroke, seizures and migraine. The mechanisms underlying SD in its various forms are still incompletely understood. Here we describe SD-like events in an invertebrate model, the ventilatory central pattern generator (CPG) of locusts. Using K(+) -sensitive microelectrodes, we measured extracellular K(+) concentration ([K(+)](o)) in the metathoracic neuropile of the CPG while monitoring CPG output electromyographically from muscle 161 in the second abdominal segment to investigate the role K(+) in failure of neural circuit operation induced by various stressors. Failure of ventilation in response to different stressors (hyperthermia, anoxia, ATP depletion, Na(+)/K(+) ATPase impairment, K(+) injection) was associated with a disturbance of CNS ion homeostasis that shares the characteristics of CSD and SD-like events in vertebrates. Hyperthermic failure was preconditioned by prior heat shock (3 h, 45 degrees C) and induced-thermotolerance was associated with an increase in the rate of clearance of extracellular K(+) that was not linked to changes in ATP levels or total Na(+)/K(+) ATPase activity. Our findings suggest that SD-like events in locusts are adaptive to terminate neural network operation and conserve energy during stress and that they can be preconditioned by experience. We propose that they share mechanisms with CSD in mammals suggesting a common evolutionary origin.