Firstly, depolarization of the neuronal membrane occurs. This is due to a stimulus which causes voltage-gated sodium ion channels to open, allowing sodium ions to diffuse down their concentration gradient into the neuron and creating a more positive charge within the neuron. Next, repolarization occurs as the membrane potential reaches a highly positive charge causing the voltage-gated sodium ion channels to close, preventing further diffusion of sodium ions into the cell. Voltage-gated potassium ion channels then open to allow potassium ions to diffuse down their concentration gradient out of the neuron, causing inside the neuron to become less positive.Finally, hyperpolarization occurs as the neuron reaches a membrane potential which is more negative than the resting potential. At this point the voltage-gated potassium ion channels close and prevents potassium ions from leaving the neuron and the sodium-potassium pump begins actively transporting potassium ions out of the cell to return the membrane to its resting potential.