Tax lien on preforeclosure

Is the IRS/State tax lien attached to the property when purchased as a pre-foreclosure the same as when buying at the trustee sale?