The factors shaping cometary nuclei are still largely unknown, but could be the result of concurrent effects of evolutionary and primordial processes. The peculiar bilobed shape of comet 67P/Churyumov-Gerasimenko may be the result of the fusion of two objects that were once separate or the result of a localized excavation by outgassing at the interface between the two lobes. Here we report that the comet's major lobe is enveloped by a nearly continuous set of strata, up to 650 metres thick, which are independent of an analogous stratified envelope on the minor lobe. Gravity vectors computed for the two lobes separately are closer to perpendicular to the strata than those calculated for the entire nucleus and adjacent to the neck separating the two lobes. Therefore comet 67P/Churyumov-Gerasimenko is an accreted body of two distinct objects with `onion-like' stratification, which formed before they merged. We conclude that gentle, low-velocity collisions occurred between two fully formed kilometre-sized cometesimals in the early stages of the Solar System. The notable structural similarities between the two lobes of comet 67P/Churyumov-Gerasimenko indicate that the early-forming cometesimals experienced similar primordial stratified accretion, even though they formed independently.