We present a total-field anomaly inversion method to determine both the basement relief and the magnetization direction (inclination and declination) of a 2D sedimentary basin presuming negligible sediment magnetization. Our method assumes that the magnetic intensity contrast is constant and known. We use a nonspectral approach based on approximating the vertical cross section of the sedimentary basin by a polygon, whose uppermost vertices are forced to coincide with the basin outcrop, which are presumably known. For fixed values of the x coordinates our method estimates the z coordinates of the unknown polygon vertices. To obtain the magnetization direction we assume that besides the total-field anomaly, information about the basement's outcrops at the basin borders and the basement depths at a few points is available. To obtain stable depth-to-basement estimates we impose overall smoothness and positivity constraints on the parameter estimates. Tests on synthetic data showed that the simultaneous estimation of the irregular basement relief and the magnetization direction yields good estimates for the relief despite the mild instability in the magnetization direction. The inversion of aeromagnetic data from the onshore Almada Basin, Brazil, revealed a shallow, eastward-dipping basement basin.