The collective motion of microswimmers in suspensions induce patterns of vortices on scales that are much larger than the characteristic size of a microswimmer, attaining a state called bacterial turbulence. Hydrodynamic turbulence acts on even larger scales and is dominated by inertial transport of energy. Using an established modification of the Navier-Stokes equation that accounts for the small-scale forcing of hydrodynamic flow by microswimmers, we study the properties of a dense suspension of microswimmers in two dimensions, where the conservation of enstrophy can drive an inverse cascade through which energy is accumulated on the largest scales. We find that the dynamical and statistical properties of the flow show a sharp transition to the formation of vortices at the largest length scale. The results show that 2D bacterial and hydrodynamic turbulence are separated by a subcritical phase transition.