On the shelf and upper slope off Peru the signal of coastal upwelling productivity and bottom-water oxygen is well preserved in alternately laminated and bioturbated diatomaceous Quaternary sediments. Global sea-level fluctuations are the ultimate cause for these cyclic facies changes. During late Miocene time, coastal upwelling was about 100 km west of the present centers, along the edge of an emergent structure that subsequently subsided to form the modern slope. The sediments are rich in organic carbon, and intense microbially mediated decomposition of organic matter is evident in sulfate reduction and methanogenesis. These processes are accompanied by the formation of diagenetic carbonates, mostly Ca-rich dolomites and Mg-calcites. The downhole isotopic signatures of these carbonate cements display distinct successions that reflect the vertical evolution of the pore fluid environment. From the association of methane gas hydrates, burial depth, and low-chloride interstitial fluids, we suggest an additional process that could contribute to the characteristic chloride depletion in pore fluids of active margins: release of interlayer water from clays without a mineral phase change. The shelf sediments also contain a subsurface brine that stretches for more than 500 km from north to south over the area drilled. The source of the brine remains uncertain, although the composition of the oxygen isotopes suggests dissolution of evaporites by seawater.