We present a method to estimate the basement relief as well as the density contrast at the surface and the hyperbolic decaying factor of the density contrast with depth, assuming that the gravity anomaly and the depth to the basement at a few points are known. In both cases, the interpretation model is a set of vertical rectangular 2D prisms whose thicknesses are parameters to be estimated and that represent the depth to the interface separating sediments and basement. The solutions to both problems are stable because of the incorporation of additional prior information about the smoothness of the estimated relief and the depth to the basement at a few locations, presumably provided by boreholes. The method was tested with synthetic gravity anomalies produced by simulated sedimentary basins with smooth relief, providing not only well-resolved estimated relief, but also good estimates for the density contrasts at the surface and for the decaying factors of the density contrast with depth. The method was applied to the Bouguer anomaly from Recôncavo Basin, estimating the surface density contrast and the decaying factor of the density contrast with depth as and 30 km, respectively.