Hydrothermally altered carbonate rocks are an important host to Rosh Pinah-type base metal sulphide mineralisation in the Pan-African Gariep Belt in southern Namibia. In order to elucidate the genesis and environment of formation of these carbonates, as well as the nature of the hydrothermal alteration, a geochemical as well as C and O isotopic study of these rocks was carried out. The results obtained from two localities, one being proximal to an inferred volcanic centre and the other being in a more distal position at the Rosh Pinah mine, revealed a primary sedimentary origin for most of the carbonates. Original limestone beds were altered to variable extent during early diagenesis by a hydrothermal, dolomitising fluid that most likely emanated from local, rift-related felsic magmatism. Enrichment in some base metals, such as Cu, can be related to this magmatism, whereas others, notably Zn and Pb, are not derived from the magma but sourced in the underlying pre-Gariep Mesoproterozoic basement. Sedimentological and isotopic evidence indicates a shallow marine setting in a restricted basin. An anoxic event, required for the formation of massive sulphide bodies, is postulated to have occurred during a cold period and is explained by eustatic drop in sea level, which caused the separation from the open ocean and subsequent starvation of the depositional basin for the Rosh Pinah Formation.