A method for controlling an active power filter using neural networks Is presented. Currently, there is an increase of voltage and current harmonics in power systems, caused by nonlinear loads. The active power filters (APFs) are used to compensate the generated harmonics and to correct the load power factor. The proposed control design is a pulse width modulation control (PWM) with two blocks that include neural networks. Adaptive networks estimate the reference compensation currents. On the other hand, a multilayer perceptron feedforward network (trained by a backpropagation algorithm) that works as a hysteresis band comparator is used. Two practical cases with Matlab-Simulink are presented to check the proposed control performance.