The New Horizons spacecraft’s encounter with the cold classical Kuiper Belt object (486958) Arrokoth (provisional designation 2014 MU69) revealed a contact-binary planetesimal. We investigated how Arrokoth formed and found that it is the product of a gentle, low-speed merger in the early Solar System. Its two lenticular lobes suggest low-velocity accumulation of numerous smaller planetesimals within a gravitationally collapsing cloud of solid particles. The geometric alignment of the lobes indicates that they were a co-orbiting binary that experienced angular momentum loss and subsequent merger, possibly because of dynamical friction and collisions within the cloud or later gas drag. Arrokoth’s contact-binary shape was preserved by the benign dynamical and collisional environment of the cold classical Kuiper Belt and therefore informs the accretion processes that operated in the early Solar System.