This work describes a method to carry out 2-D inversion of gravity data in terms of porosity and matrix density distribution using previous DC resistivity inversion results to constraint the fractional pore-water content in the rocks. The inversion is carried out using a controlled random search (CRS) algorithm for global optimization. The method was tested on synthetic data generated from a model representing a graben, and the results show that it can estimate accurate values of contrast-density and porosity. The method was also applied to gravity and dc experimental data collected in NE Portugal, showing results that agree quite well with the known geological information.