The disappearance of iron formations from the geological record approximately 1.8 billion years (Gyr) ago was the consequence of rising oxygen levels in the atmosphere starting 2.45-2.32 Gyr ago. It marks the end of a 2.5-Gyr period dominated by anoxic and iron-rich deep oceans. However, despite rising oxygen levels and a concomitant increase in marine sulphate concentration, related to enhanced sulphide oxidation during continental weathering, the chemistry of the oceans in the following mid-Proterozoic interval (approximately 1.8-0.8 Gyr ago) probably did not yet resemble our oxygen-rich modern oceans. Recent data indicate that marine oxygen and sulphate concentrations may have remained well below current levels during this period, with one model indicating that anoxic and sulphidic marine basins were widespread, and perhaps even globally distributed. Here we present hydrocarbon biomarkers (molecular fossils) from a 1.64-Gyr-old basin in northern Australia, revealing the ecological structure of mid-Proterozoic marine communities. The biomarkers signify a marine basin with anoxic, sulphidic, sulphate-poor and permanently stratified deep waters, hostile to eukaryotic algae. Phototrophic purple sulphur bacteria (Chromatiaceae) were detected in the geological record based on the new carotenoid biomarker okenane, and they seem to have co-existed with communities of green sulphur bacteria (Chlorobiaceae). Collectively, the biomarkers support mounting evidence for a long-lasting Proterozoic world in which oxygen levels remained well below modern levels.