A linear initial-value code is used to study the combined effect of resistivity and viscosity on the stability of a static z-pinch. Resistivity alone is seen to have only a minor effect, even at Lundquist parameters for which neglecting the evolution of the equilibrium is unjustified. However, the introduction of a scalar viscosity leads to strong damping of m = 0 and m = 1 modes, and can completely stabilize short-wavelength perturbations. In agreement with SPIES (1988, Plasma Phys. Contr. Fusion 30, 1025), the stability threshold is found to be given in terms of the product of the Lundquist parameter and the viscous Reynolds number, so that the mode stability is due to the combined effect of resistivity and viscosity. When the scalar viscosity is replaced by the full ion stress tensor, the damping is seen to become less effective as the viscosity becomes more anisotropic. However, linear growth-rates are still significantly reduced for typical z-pinch parameters.