We incorporate 3D anelastic attenuation into the spectral-element method for seismic wave propagation. This advancement accommodates lateral variations in anelasticity on global, regional, or local scales. We use the method to investigate the effects of anelasticity in an upper mantle attenuation model in conjunction with a global wave-speed model and in a regional subduction zone model. These investigations reveal substantial and competing amplitude anomalies due to elastic and anelastic variations, but rather minor anelastic effects on the travel times of seismic waves. Seismic studies utilizing amplitude data must therefore consider elastic and anelastic heterogeneity in tandem to avoid mapping one type of heterogeneity into the other.