Sedimentary successions of Mesozoic age have been studied in the Mandawa Basin, with the emphasis on describing facies and facies associations to provide information about the depositional environments. The diagenetic history of the sandstones is outlined by the use of petrographical studies. Further, the Mandawa Basin is the most promising hydrocarbon prospective onshore in Tanzania, and the petrographic and diagenetic observations in this study will provide information about the reservoir properties of the sandstones. With the recently discovery of the offshore gas field by Statoil in Block 2, the onshore-offshore relation of the sandstones is of great interest. Two samples of the offshore areas will be compared to the onshore sandstones studied in this thesis. The study of field outcrops consisting of sandstones of the Upper Kipatimu Mb., Upper Mitole Mb., and Makonde Fm. display deposition environment within different alluvial regimes. Upper Kipatimu Mb. was deposited in a braided river system, and authigenic kaolinite is the dominant diagenetic cement, reducing the porosity and permeability. Upper Mitole Mb. deposited in and tidal channel, whereas Makonde Fm. deposited in an terminal distrubutrary channel. Both Upper Mitole Mb. and Makonde Mb. experienced mechanical infilatration of clay in an early stage, and developed severe authigenic clay coatings of a smectite-chlortie mixed clay. The studied cores from well site 21 and 24 displays a marine depositional setting within the outer shelf and upper slope environment. These sandstones consists of higly cemented turbidtitc sandstones, where sparitic calcite cement is the major cement. In addition dolomite and ankerite is present. Porosities are generally low in the cemented units, but few units without any cement and high porosities is obsevered within the cores. The study reveals that the reservoir quality of the Mesozoic sandstones within Mandawa Basin are significantly affected by early diagenetic processes related to the sedimentary facies in alluvial and marginal marine environments. The precipitation of early diagenetic cements has strongly influenced the present-day porosity. Knowledge of the influence of sedimentology on diagenetic patterns is an important element for improved understanding and predictions of reservoir quality in the Mandawa Basin sandstone. The onshore-offshore comparison shows similarities in composition, which could indicate that the sediments offshore could have derived from the Mandawa Basin.