Pseudo-continuous arterial spin labeling (PCASL) MRI has become a popular tool for non-invasive perfusion imaging and angiography. However, it suffers from sensitivity to off-resonance effects within the labeling plane, which can be exacerbated at high field or in the presence of metallic implants, leading to spatially varying signal loss and cerebral blood flow underestimation. In this work we propose a prospective correction technique based on the optimized encoding scheme, which allows the rapid calculation of transverse gradient blips and RF phase modulations that best cancel phase offsets due to off-resonance at the locations of the feeding arteries within the labeling plane. This calculation is based upon a rapidly acquired single-slice fieldmap and is applicable to any number and arrangement of arteries. In addition, this approach is applicable to both conventional PCASL and a vessel-selective variant known as vessel-encoded PCASL (VEPCASL). Through simulations and experiments in healthy volunteers it was shown that in the presence of off-resonance effects a strong bias in the strength of the perfusion signal across vascular territories can be introduced, the signal-to-noise ratio (SNR) efficiency of PCASL and VEPCASL can be severely compromised (∼40% reduction in vivo), and that vessel-selective signal in VEPCASL can be incorrectly assigned. Distortion of the spatial regions placed in the label or control conditions in the presence of off-resonance effects was confirmed in phantom experiments. The application of the proposed correction restored SNR efficiency to levels present in the absence of off-resonance effects and corrected errors in the vascular territory maps derived from VEPCASL. Due to the rapid nature of the required calculations and fieldmap acquisition, this approach could be inserted into protocols with minimal effect on the total scan time.