A modal stability analysis shows that pressure-driven pipe flow of an Oldroyd-B fluid is linearly unstable to axisymmetric perturbations, in stark contrast to its Newtonian counterpart which is linearly stable at all Reynolds numbers. The dimensionless groups that govern stability are the Reynolds number $Re = \rho U_{max} R /\eta$, the elasticity number $E = \lambda \eta /(R^2 \rho )$ and the ratio of solvent to solution viscosity $\beta = \eta _s/\eta$; here, $R$ is the pipe radius, $U_{max}$ is the maximum velocity of the base flow, $\rho$ is the fluid density and $\lambda$ is the microstructural relaxation time. The unstable mode has a phase speed close to $U_{max}$ over the entire unstable region in ($Re$, $E$, $\beta$) space. In the asymptotic limit $E (1-\beta ) \ll 1$, the critical Reynolds number for instability diverges as $Re_c \sim (E (1-\beta ))^{-3/2}$, the critical wavenumber increases as $k_c \sim (E (1-\beta ))^{-1/2}$, and the unstable eigenfunction is localized near the centreline, implying that the unstable mode belongs to a class of viscoelastic centre modes. In contrast, for $\beta \rightarrow 1$ and $E \sim 0.1$, $Re_c$ can be as low as $O(100)$, with the unstable eigenfunction no longer being localized near the centreline. Unlike the Newtonian transition which is dominated by nonlinear processes, the linear instability discussed in this study could be very relevant to the onset of turbulence in viscoelastic pipe flows. The prediction of a linear instability is, in fact, consistent with several experimental studies on pipe flow of polymer solutions, ranging from reports of ‘early turbulence’ in the 1970s to the more recent discovery of ‘elasto-inertial turbulence’ (Samanta et al., Proc. Natl Acad. Sci. USA, vol. 110, 2013, pp. 10557–10562). The instability identified in this study comprehensively dispels the prevailing notion of pipe flow of viscoelastic fluids being linearly stable in the $Re$–$W$ plane ($W = Re \, E$ being the Weissenberg number), marking a possible paradigm shift in our understanding of transition in rectilinear viscoelastic shearing flows. The predicted unstable eigenfunction should form a template in the search for novel nonlinear elasto-inertial states, and could provide an alternate route to the maximal drag-reduced state in polymer solutions. The latter has thus far been explained in terms of a viscoelastic modification of the nonlinear Newtonian coherent structures.