Computational modeling of spreading depression (SD) has been used increasingly to study the different mechanisms that are involved in this phenomenon. One of them that is still under discussion involves the mechanisms that originate the extracellular electrical field responsible for the dc potential shift. The main goal of this paper is to present a mathematical derivation for the extracellular electric field that is incorporated in a SD model that has the basic structure of Tuckwell and Miura's model, but with the ionic variations calculated electrochemically. Electrodiffusion equations were used to describe the ionic movement of the four ions Na+, K+, Cl-, and Ca2+. These are mutually coupled by the electric field within the extracellular space (ECS). The results from the simulations show that the model is able to calculate the effect of the ionic changes along the ECS on the electric field, and to reproduce the SD in respect to the most important features that characterize the phenomenon experimentally in the retina or hippocampus. It is suggested that the extracellular negative field-potential shift during SD is due to an electrical field generated by a Goldman-Hodgkin-Katz equation acting within the ECS.