Multi-petawatt laser systems will open up a novel interaction regime mixing collective plasma and quantum electrodynamic processes, giving rise to prolific generation of gamma-ray photons and electron–positron pairs. Here, using particle-in-cell simulations, we investigate the physics of the interaction of a 1024 W cm−2 intensity, 30 fs duration, circularly polarized laser pulse with a long deuterium plasma at classically overcritical electron density (1022 cm−3). We show that radiative trapping of the plasma electrons causes a high-density (∼5 × 1023 cm−3), quasineutral electron–ion bunch to form inside the laser pulse. This phenomenon is accompanied by up to ∼40% energy conversion efficiency of the laser into gamma rays. Moreover, we find that both the radiation-modified Laplace force and the longitudinal electric field exerted on the positrons created by the multiphoton Breit–Wheeler process can accelerate them to GeV-range energies. We develop a theoretical model, the predictions of which provide a good match to the simulation results. Finally, we address the influence of the ion mass, showing that the laser absorption and positron acceleration is enhanced with deuterons compared to protons.