Excitotoxicity can occur from substances produced within the body (endogenous excitotoxins). Glutamate is a prime example of an excitotoxin in the brain, and it is also the major excitatory neurotransmitter in the central nervous system of mammals. During normal conditions, glutamate concentration can be increased up to 1mM in the synaptic cleft, which is rapidly decreased in the lapse of milliseconds. When the glutamate concentration around the synaptic cleft cannot be decreased or reaches higher levels, the neuron kills itself by a process called apoptosis.
This pathologic phenomenon can also occur after brain injury and spinal cord injury. Within minutes after spinal cord injury, damaged neural cells within the lesion site spill glutamate into the extracellular space where glutamate can stimulate presynaptic glutamate receptors to enhance the release of additional glutamate. Brain trauma or stroke can cause  ischemia, in which blood flow is reduced to inadequate levels. Ischemia is followed by accumulation of glutamate and aspartate in the extracellular fluid, causing cell death, which is aggravated by lack of oxygen and glucose. The biochemical cascade resulting from ischemia and involving excitotoxicity is called the ischemic cascade. Because of the events resulting from ischemia and glutamate receptor activation, a deep chemical coma may be induced in patients with brain injury to reduce the metabolic rate of the brain (its need for oxygen and glucose) and save energy to be used to remove glutamate actively. (The main aim in induced comas is to reduce the intracranial pressure, not brain metabolism).
Increased extracellular glutamate levels leads to the activation of Ca permeable NMDA receptors on myelin sheaths and oligodendrocytes, leaving oligodendrocytes susceptible to Ca influxes and subsequent excitotoxicity. One of the damaging results of excess calcium in the cytosol is initiating apoptosis through cleaved caspase processing. Another damaging result of excess calcium in the cytosol is the opening of the mitochondrial permeability transition pore, a pore in the membranes of mitochondria that opens when the organelles absorb too much calcium. Opening of the pore may cause mitochondria to swell and release reactive oxygen species and other proteins that can lead to apoptosis. The pore can also cause mitochondria to release more calcium. In addition, production of adenosine triphosphate (ATP) may be stopped, and ATP synthase may in fact begin hydrolysing ATP instead of producing it, which is suggested to be involved in depression.
Inadequate ATP production resulting from brain trauma can eliminate electrochemical gradients of certain ions.  Glutamate transporters require the maintenance of these ion gradients to remove glutamate from the extracellular space. The loss of ion gradients results in not only the halting of glutamate uptake, but also in the reversal of the transporters. The Na-glutamate transporters on neurons and astrocytes can reverse their glutamate transport and start secreting glutamate at a concentration capable of inducing excitotoxicity. This results in a buildup of glutamate and further damaging activation of glutamate receptors.
On the molecular level, calcium influx is not the only factor responsible for apoptosis induced by excitoxicity. Recently, it has been noted that extrasynaptic NMDA receptor activation, triggered by both glutamate exposure or hypoxic/ischemic conditions, activate a CREB (cAMP response element binding) protein shut-off, which in turn caused loss of mitochondrial membrane potential and apoptosis. On the other hand, activation of synaptic NMDA receptors activated only the CREB pathway, which activates BDNF (brain-derived neurotrophic factor), not activating apoptosis.