This paper proposes a repetitive-based controller for active power filters, which compensates selected current harmonics produced by distorting loads. The approach is based on the measurement of line currents and performs the compensation of selected harmonics using a closed-loop repetitive-based control scheme based on a finite-impulse response digital filter. Compared to conventional solutions based on stationary-frame current control, this approach allows full compensation of selected frequencies, even if the active filter has limited bandwidth. Compared to synchronous-frame harmonic regulations on line currents, the complexity of the proposed algorithm is independent of the number of compensated harmonics. Moreover, it is more appropriate for digital signal processor implementation and less sensitive to rounding and quantization errors when finite word length or fixed-point implementation is considered. Experimental results on a 5-kVA prototype confirm the theoretical expectations.