The stabilizing effect of a sheared axial flow is investigated in an axially flowing Z-pinch that is 1 m long with a 1 cm radius. After pinch assembly the plasma is magnetically confined for an extended quiescent period where the magnetic fluctuation levels of the azimuthal modes m = 1, 2, 3 are significantly reduced. Time-resolved Doppler shifts of plasma impurity lines are measured to determine the plasma axial velocity profiles showing a large, but sub-Alfvenic, sheared flow during the quiescent period and low shear profiles during periods of high mode activity. The plasma has a sheared axial flow that exceeds the theoretical threshold for stability during the quiescent period and is lower than the threshold during periods of high mode activity. The sheared flow profile is coincident with a plasma quiescent period where magnetic mode fluctuations are low. The threshold value and plasma lifetime are experimentally adjusted by controlling the plasma density and plasma supply, which is varied by altering the amount of injected neutral gas. Nonlinear simulations of the Z-pinch are performed using Mach2 for a static plasma, a uniform shear, and a shear localized at the pinch radius.