We investigate the formation of the first stars at the end of the cosmic dark ages with a suite of three-dimensional, moving-mesh simulations that directly resolve the collapse of the gas beyond the formation of the first protostar at the centre of a dark matter minihalo. The simulations cover more than 25 orders of magnitude in density and have a maximum spatial resolution of 0.05 R⊙, which extends well below the radius of individual protostars and captures their interaction with the surrounding gas. In analogy to previous studies that employed sink particles, we find that the Keplerian disc around the primary protostar fragments into a number of secondary protostars, which is facilitated by H2 collisional dissociation cooling and collision-induced emission. The further evolution of the protostellar system is characterized by strong gravitational torques that transfer angular momentum between the secondary protostars formed in the disc and the surrounding gas. This leads to the migration of about half of the secondary protostars to the centre of the cloud in a free-fall time, where they merge with the primary protostar and enhance its growth to about five times the mass of the second most massive protostar. By the same token, a fraction of the protostars obtain angular momentum from other protostars via N-body interactions and migrate to higher orbits. On average, only every third protostar survives until the end of the simulation. However, the number of protostars present at any given time increases monotonically, suggesting that the system will continue to grow beyond the limited period of time simulated here.