This paper describes an ad hoc modified version of the electrical circuit analysis program SPICE, which has been optimized for detailed simulations of the behaviour of neurons. An equivalent-circuit description of the simulation building blocks is provided, and the SPICE modifications are specified. These modifications, in contrast to previous uses of SPICE, allows one to simulate the behaviour of neurons of Hodgkin-Huxley type (excitable membrane) and of postsynaptic membranes without any approximations. Simulation results are reported and compared, both with data previously analysed in the literature by other authors and with experimental data recently obtained by coupling neurons to planar extracellular microelectrodes. Details of the circuit elements used in the simulations are reported. The improvements of our proposed model are discussed in comparison with a previous SPICE-based model described in the literature.