Aims. This paper examines the outflows associated with the interaction of a stellar magnetosphere with an accretion disk. In particular, we investigate the magnetospheric ejections (MEs) due to the expansion and reconnection of the field lines connecting the star with the disk. Our aim is to study the dynamical properties of the outflows and evaluate their impact on the angular momentum evolution of young protostars. Methods. Our models are based on axisymmetric time-dependent magnetohydrodynamic simulations of the interaction of the dipolar magnetosphere of a rotating protostar with a viscous and resistive disk, using alpha prescriptions for the transport coefficients. Our simulations are designed to model the accretion process and the formation of accretion funnels, the periodic inflation/reconnection of the magnetosphere and the associated MEs, and the stellar wind.Results. Similar to a magnetic slingshot, MEs can be powered by the rotation of both the disk and the star so that they can efficiently remove angular momentum from both. Depending on the accretion rate, MEs can extract a relevant fraction of the accretion torque and, together with a weak but non-negligible stellar wind torque, can balance the spin-up due to accretion. When the disk truncation approaches the corotation radius, the system enters a "propeller" regime, where the torques exerted by the disk and the MEs can even balance the spin-up due to the stellar contraction. Conclusions. Magnetospheric ejections can play an important role in the stellar spin evolution. Their spin-down efficiency can be compared to other scenarios, such as the Ghosh & Lamb, X-wind, or stellar wind models. Nevertheless, for all scenarios, an efficient spin-down torque requires a rather strong dipolar component, which has seldom been observed in classical T Tauri stars. A better analysis of the torques acting on the protostar must consider non-axisymmetric and multipolar magnetic components consistent with observations.