The dynamics of the solar magnetic field can be studied using the mean-field dynamo theory, which is based on the approximation of two scales, which suggests that the magnetic field consists of a large-scale field with small-scale fluctuations. The large-scale field can be generated by the α2 effect, related to the fluid's kinetic helicity. In the dynamo model, the α2 effect is responsible for the regeneration of both the poloidal and toroidal components of the field. The presence of chaotic transients in a nonlinear α2 dynamo is investigated through direct numerical simulations of the 3D magnetohydrodynamic equations. By varying the parameter that controls the injection of kinetic helicity into the domain, a hysteretic blowout bifurcation is conjectured to be responsible for the transition to dynamo, leading to a sudden increase in the magnetic energy of the attractor. This high-energy hydromagnetic attractor is suddenly destroyed in a boundary crisis when the helicity is decreased. Both the blowout bifurcation and the boundary crisis generate long chaotic transients that are due, respectively, to a chaotic saddle and a relative chaotic attractor.