A 300-m (1000-ft)-thick succession of shallow- and warm-water carbonates has been studied in well cores from the southernmost Barents Sea, offshore north Norway. These upper Paleozoic strata contain numerous zones of moderate to high porosity, including a wide range of depositional facies, despite moderately high burial temperatures and the absence of petroleum charge. Most porosity appears to be either primary or created during early (eogenetic) diagenesis. Negative correlation between porosity and both bulk-rock alumina content and stylolite frequency reflects the influence of phyllosilicate minerals in localizing stylolitic dissolution. This provides part of the explanation for the overall correlation between porosity and the platform's stratigraphic evolution. The early stage of mixed siliciclastic-carbonate deposition has low porosity because of extensive chemical compaction in aluminous beds. The following siliciclastic-poor stage shows upward-increasing porosity associated with aggradation of muddy buildups and wackestones, followed by the progradation of a more proximal facies belt of thinly bedded dolomitic mudstones. Maximum porosity development occurs in the overlying, little-dolomitized grain-shoal facies belt, which shows upward decrease in porosity because of a transgressive trend that developed progressively lower energy depositional conditions, favoring the occurrence of stylolite-prone shaly laminations. A general porosity-favorable factor is the presence of a stratified column of high-salinity brine, enforcing a closed diagenetic system during burial. Limestones and dolostones comprising this platform have very different proportions of low and high porosity values. Limestones have positively skewed frequency distribution (many samples <5% porosity), whereas dolostones have higher average porosity with symmetric distribution (few samples <5% porosity). The low limestone porosities result from cementation by coarse calcite-spar in grain-dominated samples and matrix compaction and cementation in muddy facies, features that are less common in dolostones possibly because of lesser propensity for stylolite development and the resistance of early-dolomitized matrix to compaction.