Direct numerical simulations are used to study the three-dimensional, incompressible and viscous flow dynamics of a base solid-body rotation flow with a uniform axial velocity entering a rotating, finite-length, straight circular pipe. Steady in time profiles of the axial, radial and circumferential velocities are prescribed along the pipe inlet. The convective boundary conditions for each velocity flux component is set at the pipe outlet. The simulation results describe the neutral stability line in response to either axisymmetric or three-dimensional perturbations in a diagram of Reynolds number ($Re$, based on inlet axial velocity and pipe radius) versus the incoming flow swirl ratio ($\unicode[STIX]{x1D714}$). This line is in good agreement with the neutral stability line recently predicted by the linear stability theory of Wang et al. (J. Fluid Mech., vol. 797, 2016, pp. 284–321). The computed time history of the velocity components at a certain point in the flow is used to describe three-dimensional phase portraits of the flow global dynamics and its long-term behaviour. They show three types of flow evolution scenarios. First, the Wang & Rusak (Phys. Fluids, vol. 8 (4), 1996, pp. 1007–1016) axisymmetric instability mechanism and evolution to a stable axisymmetric breakdown state is recovered at certain operational conditions in terms of $Re$ and $\unicode[STIX]{x1D714}$. However, at other operational conditions with same $\unicode[STIX]{x1D714}$ but with a higher $Re$, a second scenario is found. The axisymmetric breakdown state continues to evolve and a spiral instability mode appears on it and grows to a rotating spiral breakdown state. Moreover, at higher levels of $\unicode[STIX]{x1D714}$ a third scenario is found where there exists a dominant three-dimensional spiral type of instability mode that agrees with the linear stability theory of Wang et al. (J. Fluid Mech., vol. 797, 2016, pp. 284–321). The growth of this mode leads directly to a spiral type of flow roll-up and nonlinearly saturates on a rotating spiral type of vortex breakdown. The Reynolds–Orr equation is used to reveal the mechanism that drives all the instabilities as well as the nonlinear global flow evolution. At high swirl ratios, the confined kinetic energy in the swirling flow can be triggered to be released through various physical agents, such as the asymmetric inlet–outlet conditions, that eliminate axial homogeneity along the pipe and induce flow instabilities and evolution to breakdown states. It is also shown that local instability analysis or its extension using the assumption of a weakly non-parallel flow to conduct convective instability–absolute instability analyses is definitely not related to any of the instability modes found in the present study. Moreover, a stability study based on the strongly non-parallel flow character, including axial inhomogeneity due to a finite-domain boundary conditions, must be conducted to reveal instabilities in such flows.