Seismic attenuation poses challenges to velocity model building from acoustic/elastic full-waveform inversion (FWI). In particular, when constructing the FWI gradient for velocity inversion, recent studies have indicated that the high-attenuation structure could distort the gradient by damping the amplitudes and shifting the kinematic phases, resulting in an imbalanced update and thus unreliable velocity model. These Q effects are particularly significant in the reflection acquisition geometry due to the “double-damping” issue. Here, we develop a Q-compensated FWI algorithm for constructing a Q-free FWI gradient. By using a recently developed viscoacoustic wave propagator, this compensation can be done conveniently by keeping the dispersion term and flipping the dissipation term in the wave equation when we simulate the forward and time-reversed adjoint wavefields. The resultant gradient obtained by interacting these two wavefields has correct kinematics and Q-free amplitudes. This Q-compensated FWI can balance the update between Q- and no- Q-areas, which we determine using synthetic examples. In addition, we illustrate how to take advantage of the dissipation-dispersion decoupling to determine the anomalous Q value in the Q model building workflow via Q-compensated reverse time migration.