This paper presents a single-phase high power factor motor drive system with active power filter function. Since most of electrical equipment connected to the grid must comply with regulations regarding grid current harmonics, motor drive systems are generally equipped with Power Factor Corrector (PFC) which is comprised of power switches and reactive components, e.g., inductor and capacitor. The reactive components are bulky and increase the system cost especially in low-cost applications such as electrical home appliances. In this paper, a new motor drive algorithm which is capable of both driving a permanent magnet motor and filtering the harmonic currents produced by other non-linear loads belong to the system is proposed. Since the input current of the drive system is directly controlled by manipulating not the motor current reference but the output voltage reference of the inverter, it is possible to achieve exact and immediate control of the grid current. The effectiveness of the proposed algorithms is validated by experiments with a permanent magnet motor drive system.