The paper presents an improved algorithm based on Bhaskara Rao and Ramesh Babu's algorithm to invert magnetic anomalies of three-dimensional basement structures. The magnetic basement is approximated by an ensemble of juxtaposed vertical prisms whose bottom surface coincides with Curie surface with the known depth. The computer program operating with the proposed algorithm is built in Matlab environment. Test applications show that the proposed method can perform computations with fast and stable convergence rate where the results also coincide well with the actual model structure. The effectiveness of the method is demonstrated by inverting magnetic anomalies of the southeast part of Vietnam continental shelf. The calculated magnetic basement relief of the study area provides useful additional information for studies in the aim of dealing with the geological structure of the area.