We have developed a new least-squares inversion approach to determine successively the depth (z), polarization angle, and electric dipole moment of a buried structure from the self-potential (SP) anomaly data measured along a profile. This inverse algorithm makes it possible to use all the observed data when determining each of these three parameters. The problem of the depth determination has been parameterised from the forward modelling operator, and transformed into a nonlinear equation in the form (z)≤0 by minimising an objective functional in the least-squares sense. Using the estimated depth and applying the least-squares method, the polarization angle is then determined from the entire observed data by a linear formula. Finally, knowing the depth and polarization angle, the dipole moment is expressed by a linear equation and is computed using the whole measured data. This technique is applicable for a class of geometrically simple anomalous bodies, including the semi-infinite vertical cylinder, the infinitely long horizontal cylinder, and the sphere. The method is tested and verified on numerical examples with and without random noise. It is also successfully applied to two real datasets from mineral exploration in Germany and Turkey, and we have found that the estimated depths and the other SP model parameters are in good agreement with the known actual values.